Adapt back-end to the new front-end auth management

This commit is contained in:
Bubka
2023-09-27 10:50:21 +02:00
parent 48bea5721f
commit 0435cecd53
6 changed files with 26 additions and 23 deletions

View File

@ -18,15 +18,15 @@ class SinglePageController extends Controller
{
event(new ScanForNewReleaseCalled());
$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 */
$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') : '';
$defaultPreferences = 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)
@ -37,12 +37,12 @@ class SinglePageController extends Controller
'proxyLogoutUrl' => $proxyLogoutUrl,
'subdirectory' => $subdir,
])->toJson(),
'userPreferences' => $userPreferences,
'subdirectory' => $subdir,
'isDemoApp' => $isDemoApp,
'isTestingApp' => $isTestingApp,
'lang' => $lang,
'locales' => $locales,
'defaultPreferences' => $defaultPreferences,
'subdirectory' => $subdir,
'isDemoApp' => $isDemoApp,
'isTestingApp' => $isTestingApp,
'lang' => $lang,
'locales' => $locales,
]);
}
}