1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Update OAuth token on Auth. (#3119)

* Fixes for OAuth

* Update token on OAuth login
This commit is contained in:
David Bomba 2019-12-04 13:00:59 +11:00 committed by GitHub
parent fb2ca5dbe9
commit 329a9ffb73
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View File

@ -280,6 +280,8 @@ class LoginController extends BaseController
/* Handle existing users who attempt to create another account with existing OAuth credentials */
if($user = OAuth::handleAuth($socialite_user, $provider))
{
$user->token = $socialite_user->token;
$user->save();
Auth::login($user, true);
return redirect($this->redirectTo);
@ -333,6 +335,8 @@ class LoginController extends BaseController
if($user = OAuth::handleAuth($socialite_user, $provider))
{
$user->token = $socialite_user->token;
$user->save();
Auth::login($user, true);
return redirect($this->redirectTo);

View File

@ -130,7 +130,7 @@ class OAuth
$oauth_user_id = $this->provider_instance->harvestSubField($payload);
$query = [
'oauth_user_id' => oauth_user_id,
'oauth_user_id' => $oauth_user_id,
'oauth_provider_id'=> $this->provider_id
];

View File

@ -1,6 +1,3 @@
@extends('layouts.master', ['header' => $header])
@section('body')
<main class="main">
<!-- Breadcrumb-->
{{ Breadcrumbs::render('dashboard') }}
@ -16,4 +13,3 @@
</div>
</main>
@endsection