Skip to content

Commit 84d6ed4

Browse files
committed
fix: add limitation if allowMagicLinkLogins is false
1 parent b141eaf commit 84d6ed4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/Controllers/MagicLinkController.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public function __construct()
5050
*/
5151
public function loginView()
5252
{
53+
// Check if magic-link is not allowed
54+
if (! setting('Auth.allowMagicLinkLogins')) {
55+
return redirect()->route('login')->with('error', lang('Auth.magicLinkDisabled'));
56+
}
57+
5358
if (auth()->loggedIn()) {
5459
return redirect()->to(config('Auth')->loginRedirect());
5560
}
@@ -66,6 +71,11 @@ public function loginView()
6671
*/
6772
public function loginAction()
6873
{
74+
// Check if magic-link is not allowed
75+
if (! setting('Auth.allowMagicLinkLogins')) {
76+
return redirect()->route('login')->with('error', lang('Auth.magicLinkDisabled'));
77+
}
78+
6979
// Validate email format
7080
$rules = $this->getValidationRules();
7181
if (! $this->validateData($this->request->getPost(), $rules, [], config('Auth')->DBGroup)) {

0 commit comments

Comments
 (0)