aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller/Auth.pm
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2018-04-19 15:58:02 +0100
committerStruan Donald <struan@exo.org.uk>2018-06-25 10:12:25 +0100
commit7c009ce048fbe36db24dd1a24f3542503db2e898 (patch)
treedba5f5e7d0b4bab9a5d3565781fe1bbd12aff807 /perllib/FixMyStreet/App/Controller/Auth.pm
parent43ef59400d632c3c29321c6908128932a31148a7 (diff)
add a send login email button to user edit page
Add a button to the user edit page that sends a login token email to the user. Helpful for user support situations where someone is having trouble logging in. Also for situations where you have added a user and want to get them logged in. Fixes #2041
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm
index fa3403f6d..41674e377 100644
--- a/perllib/FixMyStreet/App/Controller/Auth.pm
+++ b/perllib/FixMyStreet/App/Controller/Auth.pm
@@ -224,7 +224,8 @@ sub token : Path('/M') : Args(1) {
my $data = $c->forward('get_token', [ $url_token, 'email_sign_in' ]) || return;
$c->stash->{token_not_found} = 1, return
- if $data->{old_user_id} && (!$c->user_exists || $c->user->id ne $data->{old_user_id});
+ if $data->{old_user_id} && $data->{r} && $data->{r} eq 'auth/change_email/success'
+ && (!$c->user_exists || $c->user->id ne $data->{old_user_id});
my $type = $data->{login_type} || 'email';
$c->detach( '/auth/process_login', [ $data, $type ] );