Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fresh_login_required doesn't work with FlaskLoginClient #674

Open
sopoforic opened this issue May 9, 2022 · 1 comment
Open

fresh_login_required doesn't work with FlaskLoginClient #674

sopoforic opened this issue May 9, 2022 · 1 comment

Comments

@sopoforic
Copy link

Describe the bug
When using the FlaskLoginClient to test @fresh_login_required views, they always redirect to the refresh view rather than rendering as expected.

To Reproduce

  1. Have a view with @fresh_login_required:
@app.route('/edit/')
@fresh_login_required
def edit():
    ...
  1. Attempt to visit it with the test client:
app.test_client_class = FlaskLoginClient
with app.test_client(user=user, fresh_login=True) as client:
    r = client.get("/edit/")
    assert r.status_code == 200

Expected behavior
The request should succeed, since the login should be fresh.

Desktop (please complete the following information):

  • OS: Linux
  • Flask-Login version 0.6.1

Additional context
I suspect this is the same as bug #586.

@sopoforic sopoforic changed the title 0.6.4: @fresh_login_required views don't work with FlaskLoginClient 0.6.1: @fresh_login_required views don't work with FlaskLoginClient May 9, 2022
@davidism davidism changed the title 0.6.1: @fresh_login_required views don't work with FlaskLoginClient fresh_login_required doesn't work with FlaskLoginClient Jul 26, 2022
@maxcountryman
Copy link
Owner

If this is a still an issue then please address with a proposed fix in the form of a PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants