2 ms·
> With the instant login system, you can't expire the token after its first use since the email will still be in the user's inbox where they expect it to work.
by sneak 15y ago
> With the instant login system, you can't expire the token after its first use since the email will still be in the user's inbox where they expect it to work.
As the article mentions, you can expire them after a week or so. And if you're smart enough to do this, you're smart enough to fall back gracefully to the old "login form" behavior when you get a link with an expired token.
- cdcarter 15y agoHell, you could expire them as soon as they are clicked, and then have the fallback.
- LokiSnake 15y agoAn immediate expiry would not solve the initial problem. A user can easily click on the link on an iPhone, then want to read the content on his desktop. A timed expiry would work much better.
- lamby 15y agoAnother trick is to mix in the user's hashed password when you generate and check the HMAC - that way if the user ever changes their password all the previous links fail to work.