aboutsummaryrefslogtreecommitdiffstats
path: root/perllib/FixMyStreet/App/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'perllib/FixMyStreet/App/Controller')
-rw-r--r--perllib/FixMyStreet/App/Controller/Auth.pm10
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