We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 058e668 commit cb7f25cCopy full SHA for cb7f25c
plugin.php
@@ -47,7 +47,10 @@ function atomarch_google_auth() {
47
48
if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
49
// User has already authenticated against google with an approved domain, nothing to do
50
- return true;
+ $google_oauthV2 = new Google_Service_Oauth2($google_client);
51
+ $user_info = $google_oauthV2->userinfo->get();
52
+ yourls_set_user($user_info['email']);
53
+ return true;
54
55
} else {
56
@@ -99,6 +102,7 @@ function atomarch_check_domain($google_client) {
99
102
$user_domain = substr(strrchr($user_info['email'], "@"), 1);
100
103
101
104
if (in_array($user_domain, $APPROVED_DOMAINS)) {
105
106
return true;
107
108
return false;
0 commit comments