Fix password reset link [MJ-646]

This is the same code as was already merged in #421. The ticket says we should merge to both branches, but it feels like that wouldn't be necessary.

In any case, this fixes the password reset link on working-master. All tests pass.