1
0
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:
David Bomba 2019-12-04 12:26:57 +11:00 committed by GitHub
parent 0d15926e02
commit fb2ca5dbe9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();