mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-03 16:44:36 -04:00
Response handling with microsoft
This commit is contained in:
parent
5670abe224
commit
93ebf3a767
@ -332,11 +332,6 @@ class LoginController extends BaseController
|
|||||||
if (request()->input('provider') == 'google') {
|
if (request()->input('provider') == 'google') {
|
||||||
return $this->handleGoogleOauth();
|
return $this->handleGoogleOauth();
|
||||||
} elseif (request()->input('provider') == 'microsoft') {
|
} elseif (request()->input('provider') == 'microsoft') {
|
||||||
// if (request()->has('token')) {
|
|
||||||
// return $this->handleSocialiteLogin('microsoft', request()->get('token'));
|
|
||||||
// } else {
|
|
||||||
// $message = 'Bearer token missing for the microsoft login';
|
|
||||||
// }
|
|
||||||
return $this->handleMicrosoftOauth();
|
return $this->handleMicrosoftOauth();
|
||||||
} elseif (request()->input('provider') == 'apple') {
|
} elseif (request()->input('provider') == 'apple') {
|
||||||
// if (request()->has('token')) {
|
// if (request()->has('token')) {
|
||||||
@ -501,7 +496,7 @@ class LoginController extends BaseController
|
|||||||
elseif(request()->has('access_token'))
|
elseif(request()->has('access_token'))
|
||||||
$accessToken = request()->input('access_token');
|
$accessToken = request()->input('access_token');
|
||||||
else
|
else
|
||||||
return response()->json(['message' => 'Invalid response from oauth server'], 400);
|
return response()->json(['message' => 'Invalid response from oauth server, no access token in response.'], 400);
|
||||||
|
|
||||||
$graph = new \Microsoft\Graph\Graph();
|
$graph = new \Microsoft\Graph\Graph();
|
||||||
$graph->setAccessToken($accessToken);
|
$graph->setAccessToken($accessToken);
|
||||||
@ -512,7 +507,6 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
if($user){
|
if($user){
|
||||||
|
|
||||||
$account = request()->input('account');
|
|
||||||
$email = $user->getMail() ?: $user->getUserPrincipalName();
|
$email = $user->getMail() ?: $user->getUserPrincipalName();
|
||||||
|
|
||||||
$query = [
|
$query = [
|
||||||
@ -553,6 +547,8 @@ class LoginController extends BaseController
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return response()->json(['message' => 'Unable to authenticate this user'], 400);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private function existingOauthUser($existing_user)
|
private function existingOauthUser($existing_user)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user