diff options
Diffstat (limited to 'internal/db/user_cache.go')
-rw-r--r-- | internal/db/user_cache.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/internal/db/user_cache.go b/internal/db/user_cache.go index 314ea3b1..f4fa8172 100644 --- a/internal/db/user_cache.go +++ b/internal/db/user_cache.go @@ -4,13 +4,17 @@ package db +import ( + "fmt" +) + // MailResendCacheKey returns key used for cache mail resend. func (u *User) MailResendCacheKey() string { - return "MailResend_" + u.IDStr() + return fmt.Sprintf("MailResend_%d", u.ID) } // TwoFactorCacheKey returns key used for cache two factor passcode. // e.g. TwoFactor_1_012664 func (u *User) TwoFactorCacheKey(passcode string) string { - return "TwoFactor_" + u.IDStr() + "_" + passcode + return fmt.Sprintf("TwoFactor_%d_%s", u.ID, passcode) } |