title: @flask_login.login_required not working properly
body: <p>I am using flask_login for implementing auth in my flask application</p>
  
  <p>Here are the <strong><em>unauthorized_handler</em></strong> and <strong><em>login_required</em></strong> enabled method</p>
  
  <pre><code>@login_manager.unauthorized_handler
  def unauthorized_handler():
      return redirect(url_for('login'))
  # use decorators to link the function to a url
  
  @app.route('/profile', methods=['GET'])
  @flask_login.login_required
  def profile():
      return render_template('profile.html')
  </code></pre>
  
  <p>I am using firebase as my backend service</p>
  
  <pre><code>@app.route('/login', methods=['GET', 'POST'])
  def login():
      auth = firebase.auth()
      if request.method == 'POST':
          try:
              user = auth.sign_in_with_email_and_password(request.form['email'], request.form['password'])
              if user != None:
                  return redirect(url_for('profile'))
          except requests.exceptions.HTTPError as e:
              response = e.args[0].response
              error = response.json()['error']['code']
              return redirect(url_for('home'))
      return render_template('login.html')
  </code></pre>
  
  <p>The problem is that after I login(which is successfull) the app is automatically redirected to the <code>/login</code> url instead of <code>/profle</code>.</p>
  
  <p>I tried turning my debug mode off and on still not working.</p>