diff options
author | Dave Arter <davea@mysociety.org> | 2017-02-15 13:41:38 +0000 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2017-02-15 13:41:38 +0000 |
commit | 54af489f0fe985dfc433f0b8a3ab226a470a6023 (patch) | |
tree | 29a0a89f65016cd0fc4900ea7491da67ddd2389a /perllib/FixMyStreet/App/Controller/Auth.pm | |
parent | e198a5b8ba63fb1bae68132d2a81fd6cd4ecf69a (diff) | |
parent | 8e6f6a1818b4f998d48f157387d2314bb8c86f8a (diff) |
Merge branch 'issues/forcouncils/51-close-old-reports'
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index b41e88209..70821f79d 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -223,7 +223,7 @@ sub token : Path('/M') : Args(1) { $c->authenticate( { email => $user->email }, 'no_password' ); # send the user to their page - $c->detach( 'redirect_on_signin', [ $data->{r} ] ); + $c->detach( 'redirect_on_signin', [ $data->{r}, $data->{p} ] ); } =head2 facebook_sign_in @@ -411,7 +411,7 @@ Used after signing in to take the person back to where they were. sub redirect_on_signin : Private { - my ( $self, $c, $redirect ) = @_; + my ( $self, $c, $redirect, $params ) = @_; unless ( $redirect ) { $c->detach('redirect_to_categories') if $c->user->from_body && scalar @{ $c->user->categories }; $redirect = 'my'; @@ -420,7 +420,11 @@ sub redirect_on_signin : Private { if ( $c->cobrand->moniker eq 'zurich' ) { $redirect = 'admin' if $c->user->from_body; } - $c->res->redirect( $c->uri_for( "/$redirect" ) ); + if (defined $params) { + $c->res->redirect( $c->uri_for( "/$redirect", $params ) ); + } else { + $c->res->redirect( $c->uri_for( "/$redirect" ) ); + } } =head2 redirect_to_categories |