style: gofmt the user model and the session test
This commit is contained in:
@@ -8,27 +8,27 @@ import (
|
||||
|
||||
// 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"`
|
||||
// LastSeen is stamped by login and token refresh, at most once per five
|
||||
// minutes (classes.TouchLastSeen). It is shown in the admin list and is
|
||||
// never part of a user API payload.
|
||||
|
||||
@@ -37,8 +37,8 @@ const (
|
||||
sessionSecret = "summercms-test-only-hs256-secret"
|
||||
// adminHarnessSecret signs backend tokens in tests that mount the admin API.
|
||||
adminHarnessSecret = "summercms-test-only-admin-hs256-secret"
|
||||
invalidLoginBody = `{"error":true,"message":"Invalid email or password"}`
|
||||
prvHash = "a867434cbc213adfbe78a02bed7082a6bd99c883"
|
||||
invalidLoginBody = `{"error":true,"message":"Invalid email or password"}`
|
||||
prvHash = "a867434cbc213adfbe78a02bed7082a6bd99c883"
|
||||
)
|
||||
|
||||
var (
|
||||
|
||||
Reference in New Issue
Block a user