mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
Use id_token for apple when deleting companies
This commit is contained in:
parent
db89751ebf
commit
e29b08824a
@ -521,7 +521,7 @@ class CompanyController extends BaseController
|
||||
$nmo->company = $other_company;
|
||||
$nmo->settings = $other_company->settings;
|
||||
$nmo->to_user = auth()->user();
|
||||
NinjaMailerJob::dispatch($nmo, true);
|
||||
(new NinjaMailerJob($nmo, true))->handle();
|
||||
|
||||
$company->delete();
|
||||
|
||||
|
@ -18,6 +18,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Support\Str;
|
||||
use Laravel\Socialite\Facades\Socialite;
|
||||
use stdClass;
|
||||
|
||||
class PasswordProtection
|
||||
@ -111,7 +112,18 @@ class PasswordProtection
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
elseif(auth()->user()->oauth_provider_id == 'apple')
|
||||
{
|
||||
|
||||
$user = Socialite::driver('apple')->userFromToken($request->header('X-API-OAUTH-PASSWORD'));
|
||||
|
||||
if($user && ($user->email == auth()->user()->email)){
|
||||
|
||||
Cache::put(auth()->user()->hashed_id.'_'.auth()->user()->account_id.'_logged_in', Str::random(64), $timeout);
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
return response()->json($error, 412);
|
||||
|
Loading…
x
Reference in New Issue
Block a user