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

url_for() #15

Closed
wiesson opened this issue Jun 3, 2014 · 1 comment
Closed

url_for() #15

wiesson opened this issue Jun 3, 2014 · 1 comment

Comments

@wiesson
Copy link

wiesson commented Jun 3, 2014

I think return redirect(url_for('main.index')) should be correct instead of return redirect('main.index') here?

And further, the /login view could could be extended by the following code:

@auth.route('/login', methods=['GET', 'POST'])
def login():
    if current_user.is_authenticated():
        return redirect(url_for('main.index'))
    form = LoginForm()
    ... 

The successfully logged-in user should not be able to see the login forms again? I don't know, what do you think?

@miguelgrinberg
Copy link
Owner

Thanks, I have addressed the first problem, which is clearly an omission on my part. Your second suggestion is valid, too, but given that it presents no security risk I'll leave it as is.

@wiesson wiesson closed this as completed Jun 3, 2014
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