only skip debugging screens if the endpoints are the same as before
This commit is contained in:
parent
9d917dca8e
commit
7a3532019b
1 changed files with 8 additions and 3 deletions
|
@ -107,11 +107,16 @@ $app->get('/auth/start', function() use($app) {
|
||||||
$authorizationURL = false;
|
$authorizationURL = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// If the user has already signed in before and has a micropub access token, skip
|
// If the user has already signed in before and has a micropub access token,
|
||||||
// the debugging screens and redirect immediately to the auth endpoint.
|
// 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.
|
// This will still generate a new access token when they finish logging in.
|
||||||
$user = ORM::for_table('users')->where('url', $me)->find_one();
|
$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->micropub_endpoint = $micropubEndpoint;
|
||||||
$user->authorization_endpoint = $authorizationEndpoint;
|
$user->authorization_endpoint = $authorizationEndpoint;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue