user_cache.go 385 B

1234567891011
  1. // Copyright 2018 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package models
  5. // TwoFactorCacheKey returns key used for cache two factor passcode.
  6. // e.g. TwoFactor_1_012664
  7. func (u *User) TwoFactorCacheKey(passcode string) string {
  8. return "TwoFactor_" + u.IDStr() + "_" + passcode
  9. }