Skip to content

Commit 058e668

Browse files
fix user can still login when fetchAccessTokenWithAuthCode failed (8thwall#16)
* fix user can still login when fetchAccessTokenWithAuthCode returns errro token * remove company detail * space matters Co-authored-by: wb <[email protected]>
1 parent 1d8d711 commit 058e668

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

plugin.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ function atomarch_google_auth() {
6161
} else {
6262
// Exchange an authorization code for an access token
6363
$token = $client->fetchAccessTokenWithAuthCode($_GET['code']);
64+
65+
if (!array_key_exists('access_token', $token)) {
66+
yourls_e("invalid token");
67+
die();
68+
}
6469
//Store Access Token in a session variable
6570
$_SESSION['access_token'] = $token;
6671

0 commit comments

Comments
 (0)