Skip to content

Commit

Permalink
adding updates to the verify and register functionality
Browse files Browse the repository at this point in the history
  • Loading branch information
tnylea committed May 22, 2024
1 parent 9bfed50 commit 05c8d0d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion resources/views/pages/auth/register.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,11 @@ public function register()
Auth::login($user, true);
return redirect()->intended('/');
if(config('devdojo.auth.settings.registration_require_email_verification')){
return redirect()->route('verification.notice');
}
return redirect()->intended(config('devdojo.auth.settings.redirect_after_auth'));
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/Http/Controllers/VerifyEmailController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ class VerifyEmailController
public function __invoke(EmailVerificationRequest $request): RedirectResponse
{
if ($request->user()->hasVerifiedEmail()) {
return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
return redirect()->intended(config('devdojo.auth.settings.redirect_after_auth').'?verified=1');
}

if ($request->user()->markEmailAsVerified()) {
event(new Verified($request->user()));
}

return redirect()->intended(route('dashboard', absolute: false).'?verified=1');
return redirect()->intended(config('devdojo.auth.settings.redirect_after_auth').'?verified=1');
}
}

0 comments on commit 05c8d0d

Please sign in to comment.