2018-05-21 14:24:06 +08:00
|
|
|
// Copyright 2018 The Gogs Authors. All rights reserved.
|
|
|
|
|
// Use of this source code is governed by a MIT-style
|
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
2019-10-24 01:51:46 -07:00
|
|
|
package db
|
2018-05-21 14:24:06 +08:00
|
|
|
|
2022-10-09 22:55:32 +08:00
|
|
|
import (
|
|
|
|
|
"fmt"
|
|
|
|
|
)
|
|
|
|
|
|
2018-05-21 14:45:47 +08:00
|
|
|
// MailResendCacheKey returns key used for cache mail resend.
|
|
|
|
|
func (u *User) MailResendCacheKey() string {
|
2022-10-09 22:55:32 +08:00
|
|
|
return fmt.Sprintf("MailResend_%d", u.ID)
|
2018-05-21 14:45:47 +08:00
|
|
|
}
|
|
|
|
|
|
2018-05-21 14:24:06 +08:00
|
|
|
// TwoFactorCacheKey returns key used for cache two factor passcode.
|
|
|
|
|
// e.g. TwoFactor_1_012664
|
|
|
|
|
func (u *User) TwoFactorCacheKey(passcode string) string {
|
2022-10-09 22:55:32 +08:00
|
|
|
return fmt.Sprintf("TwoFactor_%d_%s", u.ID, passcode)
|
2018-05-21 14:24:06 +08:00
|
|
|
}
|