Updated account details endpoint

This commit is contained in:
Will Browning
2021-12-08 12:38:58 +00:00
parent 21fbfd0335
commit 4fbb2f4e7c
6 changed files with 167 additions and 159 deletions

View File

@@ -58,15 +58,15 @@ class VerificationController extends Controller
$verifiable = User::find($request->route('id')) ?? Recipient::find($request->route('id'));
if (is_null($verifiable)) {
throw new AuthorizationException;
throw new AuthorizationException('Email address not found.');
}
if (! hash_equals((string) $request->route('id'), (string) $verifiable->getKey())) {
throw new AuthorizationException;
throw new AuthorizationException('Invalid hash.');
}
if (! Hash::check($verifiable->getEmailForVerification(), (string) base64_decode($request->route('hash')))) {
throw new AuthorizationException;
throw new AuthorizationException('Invalid hash.');
}
if ($verifiable->hasVerifiedEmail()) {