mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 13:12:50 +01:00
Remove oauth credentials as fillable properties
This commit is contained in:
parent
d8a4994e20
commit
fa1f16f36d
@ -649,11 +649,15 @@ class LoginController extends BaseController
|
||||
'email' => $socialite_user->getEmail(),
|
||||
'oauth_user_id' => $socialite_user->getId(),
|
||||
'oauth_provider_id' => $provider,
|
||||
'oauth_user_token' => $oauth_user_token,
|
||||
'oauth_user_refresh_token' => $socialite_user->refreshToken,
|
||||
// 'oauth_user_token' => $oauth_user_token,
|
||||
// 'oauth_user_refresh_token' => $socialite_user->refreshToken,
|
||||
];
|
||||
|
||||
$user->update($update_user);
|
||||
$user->oauth_user_token = $oauth_user_token;
|
||||
$user->oauth_user_refresh_token = $socialite_user->refreshToken;
|
||||
$user->save();
|
||||
|
||||
} else {
|
||||
nlog('user not found for oauth');
|
||||
}
|
||||
@ -679,12 +683,16 @@ class LoginController extends BaseController
|
||||
'email' => $socialite_user->getEmail(),
|
||||
'oauth_user_id' => $socialite_user->getId(),
|
||||
'oauth_provider_id' => $provider,
|
||||
'oauth_user_token' => $oauth_user_token,
|
||||
'oauth_user_refresh_token' => $socialite_user->accessTokenResponseBody['refresh_token'],
|
||||
// 'oauth_user_token' => $oauth_user_token,
|
||||
// 'oauth_user_refresh_token' => $socialite_user->accessTokenResponseBody['refresh_token'],
|
||||
'oauth_user_token_expiry' => $oauth_expiry,
|
||||
];
|
||||
|
||||
$user->update($update_user);
|
||||
$user->oauth_user_refresh_token = $socialite_user->accessTokenResponseBody['refresh_token'];
|
||||
$user->oauth_user_token = $oauth_user_token;
|
||||
$user->save();
|
||||
|
||||
} else {
|
||||
nlog('user not found for oauth');
|
||||
}
|
||||
|
@ -203,10 +203,10 @@ class ConnectedAccountController extends BaseController
|
||||
$connected_account = [
|
||||
'email' => $google->harvestEmail($user),
|
||||
'oauth_user_id' => $google->harvestSubField($user),
|
||||
'oauth_user_token' => $token,
|
||||
'oauth_user_refresh_token' => $refresh_token,
|
||||
// 'oauth_user_token' => $token,
|
||||
// 'oauth_user_refresh_token' => $refresh_token,
|
||||
'oauth_provider_id' => 'google',
|
||||
'email_verified_at' =>now(),
|
||||
// 'email_verified_at' =>now(),
|
||||
];
|
||||
|
||||
if (auth()->user()->email != $google->harvestEmail($user)) {
|
||||
@ -215,6 +215,9 @@ class ConnectedAccountController extends BaseController
|
||||
|
||||
auth()->user()->update($connected_account);
|
||||
auth()->user()->email_verified_at = now();
|
||||
auth()->user()->oauth_user_token = $token;
|
||||
auth()->user()->oauth_user_refresh_token = $refresh_token;
|
||||
|
||||
auth()->user()->save();
|
||||
|
||||
$this->activateGmail(auth()->user());
|
||||
|
@ -258,6 +258,7 @@ class User extends Authenticatable implements MustVerifyEmail
|
||||
'custom_value4',
|
||||
'is_deleted',
|
||||
'oauth_user_token',
|
||||
'oauth_user_refresh_token',
|
||||
];
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user