From f3f33b809acb0b7c89fa855a9bcdcf02f6aa50cf Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Mon, 5 Oct 2026 13:02:23 +0200 Subject: [PATCH] style: gofmt the user model and the session test --- models/user.go | 42 +++++++++++++++++++++--------------------- session_test.go | 4 ++-- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/models/user.go b/models/user.go index ad348bc..bde751d 100644 --- a/models/user.go +++ b/models/user.go @@ -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. diff --git a/session_test.go b/session_test.go index f6ab691..e5e8c64 100644 --- a/session_test.go +++ b/session_test.go @@ -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 (