feat(auth): enable forced oauth login with bypass

This commit is contained in:
ryzenixx 2026-02-07 00:19:39 +01:00
parent e12c4d29e0
commit e5381814f1
No known key found for this signature in database
GPG key ID: FD01B2F0897081CB
2 changed files with 2 additions and 2 deletions

View file

@ -61,7 +61,7 @@ class FortifyServiceProvider extends ServiceProvider
$enabled_oauth_providers = OauthSetting::where('enabled', true)->get();
$users = User::count();
if ($settings->oauth_auto_redirect && $enabled_oauth_providers->where('provider', $settings->oauth_auto_redirect)->isNotEmpty()) {
if (!$request->has('skip_oauth') && $settings->oauth_auto_redirect && $enabled_oauth_providers->where('provider', $settings->oauth_auto_redirect)->isNotEmpty()) {
return redirect()->route('auth.redirect', ['provider' => $settings->oauth_auto_redirect]);
}

View file

@ -14,7 +14,7 @@
<div class="pb-4 ">Custom authentication (OAuth) configurations.</div>
</div>
<div class="mb-5">
<x-forms.select label="Forced OAuth Login" id="oauth_auto_redirect" helper="If selected, users will be automatically redirected to this provider when visiting the login page.<br>To bypass this, use <code>/login?skip_oauth=true</code> (not implemented yet, but good practice to know).">
<x-forms.select label="Forced OAuth Login" id="oauth_auto_redirect" helper="If selected, users will be automatically redirected to this provider when visiting the login page.<br>To bypass this, use <code>/login?skip_oauth=true</code>.">
<option value="">None</option>
@foreach ($oauth_settings_map as $oauth_setting)
@if ($oauth_setting['enabled'])