From 7c009ce048fbe36db24dd1a24f3542503db2e898 Mon Sep 17 00:00:00 2001 From: Struan Donald Date: Thu, 19 Apr 2018 15:58:02 +0100 Subject: 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 --- perllib/FixMyStreet/App/Controller/Auth.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm') 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 ] ); -- cgit v1.2.3