mirror of
https://github.com/Bubka/2FAuth.git
synced 2025-08-08 21:44:32 +02:00
Fix user preferences not being applied correctly after sign-in
This commit is contained in:
@ -18,21 +18,31 @@ class SinglePageController extends Controller
|
||||
{
|
||||
event(new ScanForNewReleaseCalled());
|
||||
|
||||
$subdir = config('2fauth.config.appSubdirectory') ? '/' . config('2fauth.config.appSubdirectory') : '';
|
||||
$settings = Settings::all()->toJson();
|
||||
$proxyAuth = config('auth.defaults.guard') === 'reverse-proxy-guard' ? true : false;
|
||||
$proxyLogoutUrl = config('2fauth.config.proxyLogoutUrl') ? config('2fauth.config.proxyLogoutUrl') : false;
|
||||
$subdir = config('2fauth.config.appSubdirectory') ? '/' . config('2fauth.config.appSubdirectory') : '';
|
||||
$userPreferences = Auth::user()->preferences ?? collect(config('2fauth.preferences')); /** @phpstan-ignore-line */
|
||||
$isDemoApp = config('2fauth.config.isDemoApp') ? 'true' : 'false';
|
||||
$isTestingApp = config('2fauth.config.isTestingApp') ? 'true' : 'false';
|
||||
$lang = App::getLocale();
|
||||
$locales = collect(config('2fauth.locales'))->toJson(); /** @phpstan-ignore-line */
|
||||
|
||||
// if (Auth::user()->preferences)
|
||||
|
||||
return view('landing')->with([
|
||||
'appSettings' => Settings::all()->toJson(),
|
||||
'appSettings' => $settings,
|
||||
'appConfig' => collect([
|
||||
'proxyAuth' => config('auth.defaults.guard') === 'reverse-proxy-guard' ? true : false,
|
||||
'proxyLogoutUrl' => config('2fauth.config.proxyLogoutUrl') ? config('2fauth.config.proxyLogoutUrl') : false,
|
||||
'proxyAuth' => $proxyAuth,
|
||||
'proxyLogoutUrl' => $proxyLogoutUrl,
|
||||
'subdirectory' => $subdir,
|
||||
])->toJson(),
|
||||
'userPreferences' => Auth::user()->preferences ?? collect(config('2fauth.preferences')),
|
||||
'userPreferences' => $userPreferences,
|
||||
'subdirectory' => $subdir,
|
||||
'isDemoApp' => config('2fauth.config.isDemoApp') ? 'true' : 'false',
|
||||
'isTestingApp' => config('2fauth.config.isTestingApp') ? 'true' : 'false',
|
||||
'lang' => App::getLocale(),
|
||||
'locales' => collect(config('2fauth.locales'))->toJson(), /** @phpstan-ignore-line */
|
||||
'isDemoApp' => $isDemoApp,
|
||||
'isTestingApp' => $isTestingApp,
|
||||
'lang' => $lang,
|
||||
'locales' => $locales,
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user