-
-
Notifications
You must be signed in to change notification settings - Fork 20
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
Unactivated users get wrong error message #35
Comments
hmm I am very confused now because it does seem to work locally. (maybe unintentionally fixed with Winter 1.2?) |
@AIC-BV the issue that you are running into is that the exception being thrown is an AuthException. When app.debug is enabled the message will be returned unaltered, but when it is false (i.e. in production) then the message will be replaced with a generic message for security (i.e. you don't want a bad actor to be able to figure out who has an account on your service or not). |
Yes, Thanks for pointing that out! When it is true, it is throwing the expected answers.
But as you mentioned, when debug mode is I understand your argument, but then how would I let my user know their account is not yet activated when debug mode is false? They cannot proceed as long as it is not activated, so it is a really important step. They get a popup to activate their account when registering but some people (like 1/100) just ignore the popup and click it away and then 'complain' they cannot log in |
It depends on your specific use case and users, one idea might be to resend the activation email when they attempt to login. Another (probably better approach) would be to check if the user is activated immediately after successfully validating their credentials but before authenticating their session or sending any auth cookies back and if they aren't activated at that point you can send the more helpful error message without being concerned about the security implications. |
The second one sounds a bit complex, Do I understand you correctly that I have to do some magic to check wether the user is activated or not inside the following event:
|
Yes, that would probably work. |
@LukeTowers
The code above (except the refresh 😞) would work, BUT; To solve this, I added the following code:
Would this, or something like this, be accepted in PR? |
I don't think that option is needed. I think it's common knowledge that signing into an account requires it to be activated.
Account activation via confirming via email is a very common scenario - I don't think it's necessarily likely that people will miss the email. What I would suggest is that - if the User plugin doesn't do this already - the Forgotten Password feature should count as activation (if it's set to "User") because it confirms that the user resetting their password owns the account by clicking on the link provided in the email. Then, at least, there's an out if people do actually miss the flash message, email, etc. |
That is one way of fixing the issue! Automatically activating a user on password reset sounds good, however, it feels like its a workaround of the actual issue? We get atleast two phone calls a week because of people running in to this issue. |
Isn't that what onCheckEmail does? 😅 (letting a bad actor to be able to figure out who has an account on your service or not) |
@AIC-BV yes but it is not provided in the core plugin for a reason, it's up to the developer to make the decision if that is an acceptable risk or not. |
@AIC-BV I've used the User plugin several times with the User activation enabled, and I cannot say I've had many people ask why they could not log in that turned out to be an activation issue (maybe 3 or 4 in the same amount of years?). It's all about how you onboard them after completing the registration - you could perhaps redirect them to a content page that welcomes them to the site/app and tells them to check their email for the activation message? Or write a Snowboard plugin that increases the timeout of the flash message? |
After registration there is a popup to welcome them and saying they have to activate their account via email before they can log in. Some people just ignore/don't pay attention to it.... These people get stuck in the 'activation loop'. I'm tasked with preventing the 'activation loop'. The users that didn't check their e-mail yet will never get a correct error message to let them know what they did wrong. Regardless wether it is common knowledge or not, to me, this feels like a fundamental UX issue... But; it is not a problem; I will keep my modified Account.php file from user component and update it manually 👍 I'm glad you guys helped me think of a proper solution 🤟 |
Since the reset password flow involves an email being sent to the user to confirm the password reset, this should satisfy user activation as well as the same requirement is met. Refs: #35 (comment)
Since the reset password flow involves an email being sent to the user to confirm the password reset, this should satisfy user activation as well as the same requirement is met. Refs: #35 (comment)
Hello,
My users have to activate their account before they can sign in. (Activation type: User)
This is to protect guest users from evil people 'stealing' their accounts. (my way of handling the important text block)
When a user tries to log in, that didn't activate his account yet, they get an error message like
The details you entered did not match our records. Please double-check and try again.
This error is wrong, and it should be something like
You didn't activate your account yet. Please check your email and activate your account.
and, ideally, resend the activation email.
User exists in backend user list, in database and with the onCheckEmail method. So I can change my password, but can never log in because I forgot to activate my account.
The current error message sends me in an infinite loop.
The text was updated successfully, but these errors were encountered: