user_cache.go 367 B

12345678910111213
  1. package models
  2. // MailResendCacheKey returns key used for cache mail resend.
  3. func (u *User) MailResendCacheKey() string {
  4. return "MailResend_" + u.IDStr()
  5. }
  6. // TwoFactorCacheKey returns key used for cache two factor passcode.
  7. // e.g. TwoFactor_1_012664
  8. func (u *User) TwoFactorCacheKey(passcode string) string {
  9. return "TwoFactor_" + u.IDStr() + "_" + passcode
  10. }