title: Internal Server error with Login required
body: <p>I'm getting a strange error and I can't seem to fix it. I have a NavBar that contains a link that goes to the /NavLog method but when it runs by the @login_required it produces an internal server error. I've added the app.py snippet and the part on the NavBar that the user clicks. It works fine when the user is logged in but when they are not it produces the error.</p>
  
  <pre><code>@app.route("/NavLog")
  @login_required
       def viewlog():
  return render_template("Logbook.html")
  
  &lt;div class="sidenav"&gt;
       &lt;a href="/"&gt;Home&lt;/a&gt;
       &lt;a href="/NavCross"&gt;Cross wind calculator&lt;/a&gt;
       &lt;a href="/NavAcc"&gt;Account&lt;/a&gt;
       &lt;a href="/NavLog"&gt;Logbook&lt;/a&gt;
  &lt;/div&gt;
  </code></pre>
  
  <blockquote>
    <p>TypeError: The view function did not return a valid response. The function either returned None or ended without a return statement.</p>
    
    <p>127.0.0.1 - - [11/Dec/2018 18:35:49] "GET /NavLog HTTP/1.1" 500 </p>
    
    <p>127.0.0.1 - - [11/Dec/2018 18:35:49] "GET /favicon.ico HTTP/1.1" 200 </p>
  </blockquote>