strongloop / loopback-component-oauth2

oAuth 2.0 server for LoopBack
http://www.strongloop.com
Other
62 stars 63 forks source link

Unable to identify when login is failed #21

Closed wascou closed 7 years ago

wascou commented 9 years ago

Hi,

When the component must ensure that the user is logged, depending on the grant method, we generally reach the following line of code inside oauth2-loopback.js :

login.ensureLoggedIn({ redirectTo: options.loginPage || '/login' }),

If we send back false as user, the component redirect the user to exactly the same loginPage and there's no way to indicate to the user that he does not give the right login/password.

May you make this configurable so we can set a GET param to indicate that the login did not go well ?

Cheers.

Max

wascou commented 9 years ago

I hacked the redirection for implicit protocol so I can detect in the site.js that something went wrong and show a different template for example : I replace this by this :

failureRedirect: options.loginPage + '?loginFailed' || '/login'
richardpringle commented 8 years ago

@wascou, I know this is pretty old, but any chance you want to create a PR so you get the credit?

stale[bot] commented 7 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 7 years ago

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.