mirror of
https://github.com/pelican-dev/panel.git
synced 2025-05-20 09:54:44 +02:00
handle failed oauth (#1264)
* handle failed oauths * fix linter * small cleanup --------- Co-authored-by: Boy132 <mail@boy132.de>
This commit is contained in:
parent
0e2ab4b711
commit
058b613c98
@ -44,6 +44,20 @@ class OAuthController extends Controller
|
|||||||
return redirect()->route('auth.login');
|
return redirect()->route('auth.login');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check for errors (https://www.oauth.com/oauth2-servers/server-side-apps/possible-errors/)
|
||||||
|
if ($request->get('error')) {
|
||||||
|
report($request->get('error_description') ?? $request->get('error'));
|
||||||
|
|
||||||
|
Notification::make()
|
||||||
|
->title('Something went wrong')
|
||||||
|
->body($request->get('error'))
|
||||||
|
->danger()
|
||||||
|
->persistent()
|
||||||
|
->send();
|
||||||
|
|
||||||
|
return redirect()->route('auth.login');
|
||||||
|
}
|
||||||
|
|
||||||
$oauthUser = Socialite::driver($driver)->user();
|
$oauthUser = Socialite::driver($driver)->user();
|
||||||
|
|
||||||
// User is already logged in and wants to link a new OAuth Provider
|
// User is already logged in and wants to link a new OAuth Provider
|
||||||
|
Loading…
x
Reference in New Issue
Block a user