feat: login 2fa

This commit is contained in:
Jacky 2024-07-23 17:28:13 +08:00
parent 8d8ba150ef
commit 5abd9b75bb
No known key found for this signature in database
GPG key ID: 215C21B10DF38B4D
33 changed files with 1063 additions and 122 deletions

View file

@ -1,13 +1,16 @@
package model
type Auth struct {
Model
Model
Name string `json:"name"`
Password string `json:"-"`
Status bool `json:"status" gorm:"default:1"`
Name string `json:"name"`
Password string `json:"-"`
Status bool `json:"status" gorm:"default:1"`
OTPSecret []byte `json:"-" gorm:"type:blob"`
}
type AuthToken struct {
Token string `json:"token"`
UserID int `json:"user_id"`
Token string `json:"token"`
ExpiredAt int64 `json:"expired_at" gorm:"default:0"`
}