diff options
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index 5a4243fbf..fad8941c5 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -37,8 +37,10 @@ sub general : Path : Args(0) { return unless $req->method eq 'POST'; # decide which action to take - $c->detach('email_sign_in') if $req->param('email_sign_in') - || $c->req->param('name') || $c->req->param('password_register'); + my $has_password = $req->param('sign_in') || $req->param('password_sign_in'); + my $has_email = $req->param('email_sign_in') || $req->param('name') || $req->param('password_register'); + + $c->detach('email_sign_in') if $has_email && !$has_password; $c->forward( 'sign_in' ) && $c->detach( 'redirect_on_signin', [ $req->param('r') ] ); |