2 ms·
> There's a lot of magic - and a lot of risk - in an emails_are_equal method. My whole point is that changing reset_password(user.id, email) to reset_password(
by thaumasiotes 7y ago
> There's a lot of magic - and a lot of risk - in an emails_are_equal method.
My whole point is that changing reset_password(user.id, email) to reset_password(user.id, user.email_address) neutralizes that risk. Then it doesn't matter whether emails_are_equal is risky or not, because a failure in emails_are_equal can only cause you to do a safe thing. What's less embarrassing -- "we accidentally sent a password reset for your account to you", or "we accidentally sent a password reset for your account to someone else"?
So you might not feel compelled to rewrite reset_password(user.id, email) as reset_password(user.id, user.email_address) -- but you should.