Skip to content

Commit cb7f25c

Browse files
authored
Update plugin.php
resolves issue 8thwall#15 and 8thwall#12
1 parent 058e668 commit cb7f25c

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

plugin.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,10 @@ function atomarch_google_auth() {
4747

4848
if (isset($_SESSION['access_token']) && $_SESSION['access_token']) {
4949
// User has already authenticated against google with an approved domain, nothing to do
50-
return true;
50+
$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;
5154

5255
} else {
5356

@@ -99,6 +102,7 @@ function atomarch_check_domain($google_client) {
99102
$user_domain = substr(strrchr($user_info['email'], "@"), 1);
100103

101104
if (in_array($user_domain, $APPROVED_DOMAINS)) {
105+
yourls_set_user($user_info['email']);
102106
return true;
103107
} else {
104108
return false;

0 commit comments

Comments
 (0)