From 6e387850c170743ce2ba61a890e34bc9ad8ff3b8 Mon Sep 17 00:00:00 2001 From: Matthew Somerville Date: Tue, 5 Feb 2013 10:30:06 +0000 Subject: Redirect better to prevent possible infinite loop, update test. --- perllib/FixMyStreet/App/Controller/Auth.pm | 5 ++++- 1 file changed, 4 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 aae912ad1..57b53a155 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -182,7 +182,10 @@ Used after signing in to take the person back to where they were. sub redirect_on_signin : Private { my ( $self, $c, $redirect ) = @_; $redirect = 'my' unless $redirect; - $redirect = 'admin' if $c->cobrand->moniker eq 'zurich' && $c->user->from_body; + if ( $c->cobrand->moniker eq 'zurich' ) { + $redirect = 'my' if $redirect eq 'admin'; + $redirect = 'admin' if $c->user->from_body; + } $c->res->redirect( $c->uri_for( "/$redirect" ) ); } -- cgit v1.2.3