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.
|
// User is the persisted account the JWT guard and user API load.
|
||||||
type User struct {
|
type User struct {
|
||||||
ID uint `gorm:"column:id;primaryKey"`
|
ID uint `gorm:"column:id;primaryKey"`
|
||||||
Email string `gorm:"column:email"`
|
Email string `gorm:"column:email"`
|
||||||
Password string `gorm:"column:password" json:"-"`
|
Password string `gorm:"column:password" json:"-"`
|
||||||
MustChangePassword bool `gorm:"column:must_change_password"`
|
MustChangePassword bool `gorm:"column:must_change_password"`
|
||||||
Name *string `gorm:"column:name"`
|
Name *string `gorm:"column:name"`
|
||||||
Surname *string `gorm:"column:surname"`
|
Surname *string `gorm:"column:surname"`
|
||||||
IsActivated bool `gorm:"column:is_activated"`
|
IsActivated bool `gorm:"column:is_activated"`
|
||||||
ActivatedAt *time.Time `gorm:"column:activated_at"`
|
ActivatedAt *time.Time `gorm:"column:activated_at"`
|
||||||
ActivationCode *string `gorm:"column:activation_code" json:"-"`
|
ActivationCode *string `gorm:"column:activation_code" json:"-"`
|
||||||
ActivationCodeIssuedAt *time.Time `gorm:"column:activation_code_issued_at"`
|
ActivationCodeIssuedAt *time.Time `gorm:"column:activation_code_issued_at"`
|
||||||
ResetPasswordCode *string `gorm:"column:reset_password_code" json:"-"`
|
ResetPasswordCode *string `gorm:"column:reset_password_code" json:"-"`
|
||||||
ResetPasswordCodeIssuedAt *time.Time `gorm:"column:reset_password_code_issued_at"`
|
ResetPasswordCodeIssuedAt *time.Time `gorm:"column:reset_password_code_issued_at"`
|
||||||
HasSelfSetPassword bool `gorm:"column:has_self_set_password"`
|
HasSelfSetPassword bool `gorm:"column:has_self_set_password"`
|
||||||
MarketingConsent bool `gorm:"column:marketing_consent"`
|
MarketingConsent bool `gorm:"column:marketing_consent"`
|
||||||
IsOnboarded bool `gorm:"column:is_onboarded"`
|
IsOnboarded bool `gorm:"column:is_onboarded"`
|
||||||
OrganisationID *uint `gorm:"column:organisation_id"`
|
OrganisationID *uint `gorm:"column:organisation_id"`
|
||||||
OrganisationRole *string `gorm:"column:organisation_role"`
|
OrganisationRole *string `gorm:"column:organisation_role"`
|
||||||
PreferredLocale *string `gorm:"column:preferred_locale"`
|
PreferredLocale *string `gorm:"column:preferred_locale"`
|
||||||
TokensValidAfter *time.Time `gorm:"column:tokens_valid_after"`
|
TokensValidAfter *time.Time `gorm:"column:tokens_valid_after"`
|
||||||
CreatedIPAddress *string `gorm:"column:created_ip_address"`
|
CreatedIPAddress *string `gorm:"column:created_ip_address"`
|
||||||
LastIPAddress *string `gorm:"column:last_ip_address"`
|
LastIPAddress *string `gorm:"column:last_ip_address"`
|
||||||
// LastSeen is stamped by login and token refresh, at most once per five
|
// 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
|
// minutes (classes.TouchLastSeen). It is shown in the admin list and is
|
||||||
// never part of a user API payload.
|
// never part of a user API payload.
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ const (
|
|||||||
sessionSecret = "summercms-test-only-hs256-secret"
|
sessionSecret = "summercms-test-only-hs256-secret"
|
||||||
// adminHarnessSecret signs backend tokens in tests that mount the admin API.
|
// adminHarnessSecret signs backend tokens in tests that mount the admin API.
|
||||||
adminHarnessSecret = "summercms-test-only-admin-hs256-secret"
|
adminHarnessSecret = "summercms-test-only-admin-hs256-secret"
|
||||||
invalidLoginBody = `{"error":true,"message":"Invalid email or password"}`
|
invalidLoginBody = `{"error":true,"message":"Invalid email or password"}`
|
||||||
prvHash = "a867434cbc213adfbe78a02bed7082a6bd99c883"
|
prvHash = "a867434cbc213adfbe78a02bed7082a6bd99c883"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
Reference in New Issue
Block a user