Skip to content

Commit

Permalink
Debug switch for refresh
Browse files Browse the repository at this point in the history
  • Loading branch information
lvps committed Jun 3, 2019
1 parent 4accfbf commit 76758d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions config/config-example.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@
// production key and secret are obviously different.
define('VERIFY_CERTIFICATES', true); // Set to false for development with self-signed certificates
define('CRAUTO_URL', 'http://[::1]:8200');
define('CRAUTO_DEBUG_ALWAYS_REFRESH', false); // Set to true to use the refresh token to get a new id token on each request
2 changes: 1 addition & 1 deletion src/Authentication.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public static function isLoggedIn(): bool {
return false;
}

if(!self::idTokenExpired((int) $_SESSION['expires'])) {
if(CRAUTO_DEBUG_ALWAYS_REFRESH || self::idTokenExpired((int) $_SESSION['expires'])) {
try {
return self::performRefresh();
} catch(LogicException $e) {
Expand Down

0 comments on commit 76758d8

Please sign in to comment.