Add endpoint to disable totp auth
This commit is contained in:
parent
87d0c9088d
commit
895d9613b5
4 changed files with 67 additions and 4 deletions
|
|
@ -105,6 +105,12 @@ func EnableTOTP(passcode *TOTPPasscode) (err error) {
|
|||
return
|
||||
}
|
||||
|
||||
// DisableTOTP removes all totp settings for a user.
|
||||
func DisableTOTP(user *User) (err error) {
|
||||
_, err = x.Where("user_id = ?", user.ID).Delete(&TOTP{})
|
||||
return
|
||||
}
|
||||
|
||||
// ValidateTOTPPasscode validated totp codes of users.
|
||||
func ValidateTOTPPasscode(passcode *TOTPPasscode) (t *TOTP, err error) {
|
||||
t, err = GetTOTPForUser(passcode.User)
|
||||
|
|
|
|||
Reference in a new issue