feat: 2FA authorization for web terminal

This commit is contained in:
Jacky 2024-07-23 20:35:32 +08:00
parent 802d05f692
commit 3a22861640
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
15 changed files with 359 additions and 54 deletions

View file

@ -14,3 +14,7 @@ type AuthToken struct {
Token string `json:"token"`
ExpiredAt int64 `json:"expired_at" gorm:"default:0"`
}
func (u *Auth) EnabledOTP() bool {
return len(u.OTPSecret) != 0
}