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

Report when authentication fails #14

Open
szabgab opened this issue Mar 16, 2015 · 7 comments
Open

Report when authentication fails #14

szabgab opened this issue Mar 16, 2015 · 7 comments

Comments

@szabgab
Copy link
Contributor

szabgab commented Mar 16, 2015

Currently, as I can see, if the user types in an incorrect username/password pair the default /login page will be shown again without any explanation. IMHO it would be nicer if there was a default error message about the failed authentication.

@szabgab
Copy link
Contributor Author

szabgab commented Mar 16, 2015

And I wonder if the /login page should really return 401 when accessed directly or when the login fails or if should be 200.

@racke
Copy link
Member

racke commented Mar 16, 2015

IMHO you should provide your own login page if you want to show error message to the user.
The default login page is just for testing.

@szabgab
Copy link
Contributor Author

szabgab commented Mar 16, 2015

That's probably right, but I think it would be nice if it was there without extra work. It would certainly make it simpler to show it. (demo it)

@racke
Copy link
Member

racke commented Mar 16, 2015

Actually there is support for $login_fail_message in _default_login_page. So it is probably a regression from the D1 to D2 migration.

@abeverley
Copy link
Collaborator

I noticed this when I was doing my updates. I was going to fix it at the time, but thought I should keep it separate from my PR. It's a simple fix:

my $login_fail_message = $dsl->request->vars->{login_failed}

should read

my $login_fail_message = $dsl->request->param('login_failed')

Which also means that this line can be removed:

$app->request->vars->{login_failed}++

I'll do a PR if it's easier, but if you just search the code for login_failed then you should see it.

@racke
Copy link
Member

racke commented Mar 17, 2015

I think this should be saved into the session so it can't be tampered with.

@abeverley
Copy link
Collaborator

I don't think it can be tampered with, as it's a forward not a redirect. The login_failed parameter gets added after the browser has sent the request, and therefore can't be modified?

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

3 participants