diff options
author | Dave Arter <davea@mysociety.org> | 2019-08-06 21:49:34 +0100 |
---|---|---|
committer | Dave Arter <davea@mysociety.org> | 2019-08-16 16:16:53 +0100 |
commit | 66a5779a9856bd0cd25a77666f99bc86dd4a8041 (patch) | |
tree | 2b99bf81af9735967013219a523b2fd44c20c1f3 /perllib/FixMyStreet/App/Controller/Auth.pm | |
parent | bc05c15122a8032866fdb53d285d99b3e48b3e28 (diff) |
Allow OIDC auth to provide its own ‘change password’ URI
Diffstat (limited to 'perllib/FixMyStreet/App/Controller/Auth.pm')
-rw-r--r-- | perllib/FixMyStreet/App/Controller/Auth.pm | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/perllib/FixMyStreet/App/Controller/Auth.pm b/perllib/FixMyStreet/App/Controller/Auth.pm index 964d8f19a..d4784ae8c 100644 --- a/perllib/FixMyStreet/App/Controller/Auth.pm +++ b/perllib/FixMyStreet/App/Controller/Auth.pm @@ -219,7 +219,7 @@ sub get_token : Private { sub set_oauth_token_data : Private { my ( $self, $c, $token_data ) = @_; - foreach (qw/facebook_id twitter_id oidc_id extra logout_redirect_uri/) { + foreach (qw/facebook_id twitter_id oidc_id extra logout_redirect_uri change_password_uri/) { $token_data->{$_} = $c->session->{oauth}{$_} if $c->session->{oauth}{$_}; } } @@ -291,9 +291,11 @@ sub process_login : Private { $user->update_or_insert; $c->authenticate( { $type => $data->{$type}, $ver => 1 }, 'no_password' ); - if ($data->{logout_redirect_uri}) { - $c->session->{oauth} ||= (); - $c->session->{oauth}{logout_redirect_uri} = $data->{logout_redirect_uri}; + foreach (qw/logout_redirect_uri change_password_uri/) { + if ($data->{$_}) { + $c->session->{oauth} ||= (); + $c->session->{oauth}{$_} = $data->{$_}; + } } |