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

User logged-in can access to /login using browser "go back" after login success #3

Open
panpansh opened this issue Jul 7, 2020 · 1 comment

Comments

@panpansh
Copy link

panpansh commented Jul 7, 2020

First thanks for this.
Like specified in title,
when a user is logged-in, he can access to /login using browser "go back"
(if I refresh from "/login", redirect to "/" ok)

@auth_bp.route('/login', methods=['GET', 'POST'])
def login():
    """
    Log-in page for registered users.
    GET: Serve Log-in page.
    POST: Validate form and redirect user to dashboard.
    """
    if current_user.is_authenticated:
        print(current_user.is_anonymous)
        return redirect(url_for('main_bp.dashboard'))  # Bypass if user is logged in

When I go back (after login success) "current_user.is_authenticated" never printed like they don't go here :/
(same with the print before the if).
Can you explain please if you see something ?
Regards

@panpansh
Copy link
Author

panpansh commented Jul 7, 2020

same like i'm logged-in and here : "/session"
writing "/logout" ok and now I go back from browser: result => I'm displaying session page (no redirect).
(if I refresh, redirect to "/login" ok)
Regards.

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

1 participant