aboutsummaryrefslogtreecommitdiff
path: root/models
diff options
context:
space:
mode:
authorBobby <[email protected]>2025-07-13 14:55:23 +0530
committerBobby <[email protected]>2025-07-13 14:55:23 +0530
commitcfdcbc452064854140bb572dea154d3f5c2f857b (patch)
tree03ab1319a8891c3f5ec7f692cf0655f5c624b688 /models
parent3d7f8602d45583f25e2428bf6f8123453646dc08 (diff)
downloadimageboard-cfdcbc452064854140bb572dea154d3f5c2f857b.tar.xz
imageboard-cfdcbc452064854140bb572dea154d3f5c2f857b.zip
account verification and login flow
Diffstat (limited to 'models')
-rw-r--r--models/user.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/models/user.go b/models/user.go
index 3b92077..546f600 100644
--- a/models/user.go
+++ b/models/user.go
@@ -127,6 +127,13 @@ func (u *User) CheckPassword(password string) bool {
return err == nil
}
+func (u *User) Activate() {
+ u.IsDeleted = false
+ u.AccountDisabled = false
+ u.AccountBanned = false
+ u.EmailVerified = true
+}
+
func (u *User) IsActive() bool {
return !u.IsDeleted && !u.AccountDisabled && !u.AccountBanned
}