Skip to content

Commit

Permalink
feat: allow registration process to log a user in if correct configur…
Browse files Browse the repository at this point in the history
…ation has allowed for it.
  • Loading branch information
jaymeh committed Aug 20, 2024
1 parent 6583693 commit cd55493
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/controllers/MagicLoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ public function actionRegister()
// Save the user
Craft::$app->runAction('users/save-user');

// Handle users which can be logged in automatically.
$currentUser = Craft::$app->getUser()->getIdentity();
if ($currentUser) {
return $this->redirectToPostedUrl(null, 'magic-login/login-link-sent');
}

// Send the new user a magic login link email.
Craft::$app->runAction('magic-login/magic-login/login');

Expand Down

0 comments on commit cd55493

Please sign in to comment.