phoenix_token_auth icon indicating copy to clipboard operation
phoenix_token_auth copied to clipboard

Resetting Password: Automatically logs user in even if the account isn't confirmed.

Open ACPK opened this issue 9 years ago • 6 comments

When a user resets their password, it automatically logs them into their account (i.e. doesn't check if their account is confirmed). If they log out and then try to later sign in, they get the message "Account not confirmed yet. Please follow the instructions we sent you by email."

ACPK avatar Aug 10 '15 02:08 ACPK

that's a bug. maybe we should just confirm the users account when they reset their password, as we know they entered a correct email.

manukall avatar Aug 10 '15 06:08 manukall

@manukall That sounds awesome!

ACPK avatar Aug 10 '15 23:08 ACPK

I'm just evaluating this as a possible solution for an upcoming Phoenix project (so apologies for the armchair quarterbacking), but the proposed solution feels odd. If I haven't confirmed my email, it seems strange that I could log in at all. Just because I've entered an email, doesn't mean it's mine. That's why the confirmation is required in the first place.

In practice, doesn't this mean that anyone who's able to guess an unconfirmed account's email is able to log in as that user?

clekstro avatar Aug 29 '15 22:08 clekstro

@clekstro In order to reset your password, you need to get the confirmation email. Hence, they (1) submit for password reset form, (2) click the link that gets emailed to them, and (3) get brought to a page where they change their password.

BTW, in regards to logging in when your email isn't confirmed, a few websites where you're automatically logged in before confirming your email are Github, Facebook, LinkedIn, Twitter. etc.

ACPK avatar Aug 30 '15 01:08 ACPK

@ACPK Appreciate the additional context. I didn't realize from the description above that that was the flow.

clekstro avatar Aug 30 '15 02:08 clekstro

@clekstro No problem. We're using @manukall so I recommend it but I'm adding some custom features.

ACPK avatar Aug 30 '15 02:08 ACPK