Release v6.0.13 fixes an issue with the authentication controllers.

This commit is contained in:
James Cole
2023-06-11 18:18:46 +02:00
parent f11db0de61
commit cbf8c6e80d
14 changed files with 35 additions and 48 deletions

View File

@@ -66,9 +66,7 @@ class UserController extends Controller
}
);
$this->middleware(IsDemoUser::class)->except(['index', 'show']);
$loginProvider = config('firefly.login_provider');
$authGuard = config('firefly.authentication_guard');
$this->externalIdentity = 'eloquent' !== $loginProvider || 'web' !== $authGuard;
$this->externalIdentity = 'web' !== config('firefly.authentication_guard');
}
/**

View File

@@ -64,10 +64,7 @@ class ConfirmPasswordController extends Controller
parent::__construct();
$this->middleware('auth');
$loginProvider = config('firefly.login_provider');
$authGuard = config('firefly.authentication_guard');
if ('eloquent' !== $loginProvider || 'web' !== $authGuard) {
if ('web' !== config('firefly.authentication_guard')) {
throw new FireflyException('Using external identity provider. Cannot continue.');
}
}

View File

@@ -53,10 +53,7 @@ class ForgotPasswordController extends Controller
parent::__construct();
$this->middleware('guest');
$loginProvider = config('firefly.login_provider');
$authGuard = config('firefly.authentication_guard');
if ('eloquent' !== $loginProvider || 'web' !== $authGuard) {
if ('web' !== config('firefly.authentication_guard')) {
throw new FireflyException('Using external identity provider. Cannot continue.');
}
}
@@ -72,10 +69,8 @@ class ForgotPasswordController extends Controller
public function sendResetLinkEmail(Request $request, UserRepositoryInterface $repository)
{
Log::info('Start of sendResetLinkEmail()');
$loginProvider = config('firefly.login_provider');
if ('eloquent' !== $loginProvider) {
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
Log::error($message);
return view('error', compact('message'));
@@ -117,9 +112,8 @@ class ForgotPasswordController extends Controller
*/
public function showLinkRequestForm()
{
$loginProvider = config('firefly.login_provider');
if ('eloquent' !== $loginProvider) {
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message'));
}

View File

@@ -70,10 +70,7 @@ class RegisterController extends Controller
parent::__construct();
$this->middleware('guest');
$loginProvider = config('firefly.login_provider');
$authGuard = config('firefly.authentication_guard');
if ('eloquent' !== $loginProvider || 'web' !== $authGuard) {
if ('web' !== config('firefly.authentication_guard')) {
throw new FireflyException('Using external identity provider. Cannot continue.');
}
}

View File

@@ -65,10 +65,7 @@ class ResetPasswordController extends Controller
parent::__construct();
$this->middleware('guest');
$loginProvider = config('firefly.login_provider');
$authGuard = config('firefly.authentication_guard');
if ('eloquent' !== $loginProvider || 'web' !== $authGuard) {
if ('web' !== config('firefly.authentication_guard')) {
throw new FireflyException('Using external identity provider. Cannot continue.');
}
}
@@ -84,9 +81,8 @@ class ResetPasswordController extends Controller
*/
public function reset(Request $request)
{
$loginProvider = config('firefly.login_provider');
if ('eloquent' !== $loginProvider) {
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message'));
}
@@ -131,9 +127,8 @@ class ResetPasswordController extends Controller
*/
public function showResetForm(Request $request, $token = null)
{
$loginProvider = config('firefly.login_provider');
if ('eloquent' !== $loginProvider) {
$message = sprintf('Cannot reset password when authenticating over "%s".', $loginProvider);
if ('web' !== config('firefly.authentication_guard')) {
$message = sprintf('Cannot reset password when authenticating over "%s".', config('firefly.authentication_guard'));
return view('error', compact('message'));
}