views:

155

answers:

3

When users verify their email address successfully, could I just log them in automatically?

I consider the following reasons to do so:

  • The link is a random hash
  • Users will already be annoyed by having to validate
  • I will trust anybody who has access to the email inbox anyway, since you can reset your password
  • Users can of course only validate (and therefore autologin) once

I am asking because sending a link that logs you in automatically makes me feel like I am missing something.

A: 

Yes I think you should log them in automatically. It'll be even more annoying if they have to verify their email and then log in again. What's the point of the verification then? If the verification is successful that means you already trust them, so log them in.

Nick Masao
+1  A: 

Yes you can. It's quite reasonable. As long as, as you say, you only allow it once for the given generated URL.

Slightly off-topic rambling: Though I'm slightly biased about this approach, because I happen to think that email-based login (i.e. generated login token sent to the email) is the one of the "better" ways to prevent phishing in general, because it takes away the need for the user to even know their password for your site (they just need to go to it and request a 'login' token). Anyway, that's another matter.

Noon Silk
I am not sure I understand email-based login, do users have to open an email message each time they want to login?
Gipsy King
@Gipsy: Yes, it's a separate scheme I thought of a few years ago. Yes, you'd need to visit the site and request a login 'token' which would send a one-time link to the persons account, which they would click to log in. It's arguable how practical this is, and I've never done it myself, but it *is* a general solution to the "phishing" issue that some sites suffer. It's not particularly relevant here; hence the reason I called it off-topic rambling :)
Noon Silk
@silky: Ok got it. Maybe combine it with "stay logged in" feature?
Gipsy King
@Gipsy: Yep, good idea :)
Noon Silk
+3  A: 

I think that it might be better if you at least ask them for their password for emai verification. That way, you actually verify that the email address belongs to the user.

If you auto-login, you just verify that the email address exists and that the user this email address belongs to wants access to the account.

Regarding your third point: you hopefully only trust the person(s) with access to that address once you have verified that the address actually belongs to the user (which you could do by asking for the password during verification).

ancow
I understand, if a user mistypes his email address, the owner of the mistyped address could log in and see details like full name and address.
Gipsy King