diff options
author | Aaron Parecki <aaron@parecki.com> | 2015-07-12 13:57:59 -0700 |
---|---|---|
committer | Aaron Parecki <aaron@parecki.com> | 2015-07-12 13:57:59 -0700 |
commit | 7a3532019bb992e46d1d4bd7bd1b157834a7cf69 (patch) | |
tree | 19fd05f52ba7c10ee23614bb89868f59ee9b7b1f /controllers/auth.php | |
parent | 9d917dca8ec2e2df02aedb8f9ee865bf07a3357a (diff) |
only skip debugging screens if the endpoints are the same as before
Diffstat (limited to 'controllers/auth.php')
-rw-r--r-- | controllers/auth.php | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/controllers/auth.php b/controllers/auth.php index 26aa933..1244fe0 100644 --- a/controllers/auth.php +++ b/controllers/auth.php @@ -107,11 +107,16 @@ $app->get('/auth/start', function() use($app) { $authorizationURL = false; } - // If the user has already signed in before and has a micropub access token, skip - // the debugging screens and redirect immediately to the auth endpoint. + // If the user has already signed in before and has a micropub access token, + // and the endpoints are all the same, skip the debugging screens and redirect + // immediately to the auth endpoint. // This will still generate a new access token when they finish logging in. $user = ORM::for_table('users')->where('url', $me)->find_one(); - if($user && $user->micropub_access_token && !array_key_exists('restart', $params)) { + if($user && $user->micropub_access_token + && $user->micropub_endpoint == $micropubEndpoint + && $user->token_endpoint == $tokenEndpoint + && $user->authorization_endpoint == $authorizationEndpoint + && !array_key_exists('restart', $params)) { $user->micropub_endpoint = $micropubEndpoint; $user->authorization_endpoint = $authorizationEndpoint; |