mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-05 18:52:44 +01:00
Fixes for OAuth (#3118)
This commit is contained in:
parent
0d15926e02
commit
fb2ca5dbe9
@ -249,7 +249,7 @@ class LoginController extends BaseController
|
||||
if(request()->has('code'))
|
||||
return $this->handleProviderCallback($provider);
|
||||
else
|
||||
return Socialite::driver($provider)->scopes('gmail.send')->redirect();
|
||||
return Socialite::driver($provider)->scopes('https://www.googleapis.com/auth/gmail.send')->redirect();
|
||||
}
|
||||
|
||||
|
||||
@ -261,7 +261,7 @@ class LoginController extends BaseController
|
||||
if(request()->has('code'))
|
||||
return $this->handleProviderCallbackAndCreate($provider);
|
||||
else
|
||||
return Socialite::driver($provider)->scopes('gmail.send')->redirectUrl($redirect_url)->redirect();
|
||||
return Socialite::driver($provider)->scopes('https://www.googleapis.com/auth/gmail.send')->redirectUrl($redirect_url)->redirect();
|
||||
|
||||
|
||||
}
|
||||
@ -270,7 +270,10 @@ class LoginController extends BaseController
|
||||
|
||||
public function handleProviderCallbackAndCreate(string $provider)
|
||||
{
|
||||
$redirect_url = config('services.' . $provider . '.redirect') . '/create';
|
||||
|
||||
$socialite_user = Socialite::driver($provider)
|
||||
->redirectUrl($redirect_url)
|
||||
->stateless()
|
||||
->user();
|
||||
|
||||
@ -320,7 +323,11 @@ class LoginController extends BaseController
|
||||
*/
|
||||
public function handleProviderCallback(string $provider)
|
||||
{
|
||||
|
||||
$redirect_url = config('services.' . $provider . '.redirect');
|
||||
|
||||
$socialite_user = Socialite::driver($provider)
|
||||
->redirectUrl($redirect_url)
|
||||
->stateless()
|
||||
->user();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user