feat(07-02): throttle failed logins and pick mail template locale
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,30 +1,35 @@
|
||||
package models
|
||||
|
||||
import "time"
|
||||
import (
|
||||
"time"
|
||||
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
// User is the persisted account the JWT guard and user API load.
|
||||
type User struct {
|
||||
ID uint `gorm:"column:id;primaryKey"`
|
||||
Email string `gorm:"column:email"`
|
||||
Password string `gorm:"column:password" json:"-"`
|
||||
MustChangePassword bool `gorm:"column:must_change_password"`
|
||||
Name *string `gorm:"column:name"`
|
||||
Surname *string `gorm:"column:surname"`
|
||||
IsActivated bool `gorm:"column:is_activated"`
|
||||
ActivatedAt *time.Time `gorm:"column:activated_at"`
|
||||
ActivationCode *string `gorm:"column:activation_code" json:"-"`
|
||||
ActivationCodeIssuedAt *time.Time `gorm:"column:activation_code_issued_at"`
|
||||
ResetPasswordCode *string `gorm:"column:reset_password_code" json:"-"`
|
||||
ResetPasswordCodeIssuedAt *time.Time `gorm:"column:reset_password_code_issued_at"`
|
||||
HasSelfSetPassword bool `gorm:"column:has_self_set_password"`
|
||||
MarketingConsent bool `gorm:"column:marketing_consent"`
|
||||
IsOnboarded bool `gorm:"column:is_onboarded"`
|
||||
OrganisationID *uint `gorm:"column:organisation_id"`
|
||||
OrganisationRole *string `gorm:"column:organisation_role"`
|
||||
PreferredLocale *string `gorm:"column:preferred_locale"`
|
||||
TokensValidAfter *time.Time `gorm:"column:tokens_valid_after"`
|
||||
CreatedIPAddress *string `gorm:"column:created_ip_address"`
|
||||
LastIPAddress *string `gorm:"column:last_ip_address"`
|
||||
ID uint `gorm:"column:id;primaryKey"`
|
||||
Email string `gorm:"column:email"`
|
||||
Password string `gorm:"column:password" json:"-"`
|
||||
MustChangePassword bool `gorm:"column:must_change_password"`
|
||||
Name *string `gorm:"column:name"`
|
||||
Surname *string `gorm:"column:surname"`
|
||||
IsActivated bool `gorm:"column:is_activated"`
|
||||
ActivatedAt *time.Time `gorm:"column:activated_at"`
|
||||
ActivationCode *string `gorm:"column:activation_code" json:"-"`
|
||||
ActivationCodeIssuedAt *time.Time `gorm:"column:activation_code_issued_at"`
|
||||
ResetPasswordCode *string `gorm:"column:reset_password_code" json:"-"`
|
||||
ResetPasswordCodeIssuedAt *time.Time `gorm:"column:reset_password_code_issued_at"`
|
||||
HasSelfSetPassword bool `gorm:"column:has_self_set_password"`
|
||||
MarketingConsent bool `gorm:"column:marketing_consent"`
|
||||
IsOnboarded bool `gorm:"column:is_onboarded"`
|
||||
OrganisationID *uint `gorm:"column:organisation_id"`
|
||||
OrganisationRole *string `gorm:"column:organisation_role"`
|
||||
PreferredLocale *string `gorm:"column:preferred_locale"`
|
||||
TokensValidAfter *time.Time `gorm:"column:tokens_valid_after"`
|
||||
CreatedIPAddress *string `gorm:"column:created_ip_address"`
|
||||
LastIPAddress *string `gorm:"column:last_ip_address"`
|
||||
DeletedAt gorm.DeletedAt `gorm:"column:deleted_at"`
|
||||
}
|
||||
|
||||
func (User) TableName() string { return "users" }
|
||||
|
||||
Reference in New Issue
Block a user