mirror of
https://github.com/LBPUnion/ProjectLighthouse.git
synced 2025-07-29 08:28:39 +00:00
Assert if email address already verified on SendVerificationEmailPage
This commit is contained in:
parent
e629d79f09
commit
4f601550a2
1 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,18 @@ public class SendVerificationEmailPage : BaseLayout
|
|||
User? user = this.Database.UserFromWebRequest(this.Request);
|
||||
if (user == null) return this.Redirect("/login");
|
||||
|
||||
// `using` weirdness here. I tried to fix it, but I couldn't.
|
||||
// The user should never see this page once they've been verified, so assert here.
|
||||
System.Diagnostics.Debug.Assert(!user.EmailAddressVerified);
|
||||
|
||||
// Othewise, on a release build, just silently redirect them to the landing page.
|
||||
#if !DEBUG
|
||||
if (user.EmailAddressVerified)
|
||||
{
|
||||
return this.Redirect("/");
|
||||
}
|
||||
#endif
|
||||
|
||||
EmailVerificationToken verifyToken = new()
|
||||
{
|
||||
UserId = user.UserId,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue