X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/71654810756f3be977359e5fdcd79375aab47c52..refs/pull/3918/head:/app/Http/Controllers/Auth/ConfirmEmailController.php diff --git a/app/Http/Controllers/Auth/ConfirmEmailController.php b/app/Http/Controllers/Auth/ConfirmEmailController.php index ea633ff3a..b282d0601 100644 --- a/app/Http/Controllers/Auth/ConfirmEmailController.php +++ b/app/Http/Controllers/Auth/ConfirmEmailController.php @@ -51,14 +51,28 @@ class ConfirmEmailController extends Controller return view('auth.user-unconfirmed', ['user' => $user]); } + /** + * Show the form for a user to provide their positive confirmation of their email. + */ + public function showAcceptForm(string $token) + { + return view('auth.register-confirm-accept', ['token' => $token]); + } + /** * Confirms an email via a token and logs the user into the system. * * @throws ConfirmationEmailException * @throws Exception */ - public function confirm(string $token) + public function confirm(Request $request) { + $validated = $this->validate($request, [ + 'token' => ['required', 'string'] + ]); + + $token = $validated['token']; + try { $userId = $this->emailConfirmationService->checkTokenAndGetUserId($token); } catch (UserTokenNotFoundException $exception) {