mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:47:33 +00:00
feat(api): add and remove OTP (SMS and email) (#6295)
* refactor: rename otp to totp * feat: add otp sms and email * implement tests
This commit is contained in:
@@ -48,11 +48,13 @@ type UserAuthMethodType int32
|
||||
|
||||
const (
|
||||
UserAuthMethodTypeUnspecified UserAuthMethodType = iota
|
||||
UserAuthMethodTypeOTP
|
||||
UserAuthMethodTypeTOTP
|
||||
UserAuthMethodTypeU2F
|
||||
UserAuthMethodTypePasswordless
|
||||
UserAuthMethodTypePassword
|
||||
UserAuthMethodTypeIDP
|
||||
UserAuthMethodTypeOTPSMS
|
||||
UserAuthMethodTypeOTPEmail
|
||||
userAuthMethodTypeCount
|
||||
)
|
||||
|
||||
@@ -67,15 +69,14 @@ func HasMFA(methods []UserAuthMethodType) bool {
|
||||
var factors int
|
||||
for _, method := range methods {
|
||||
switch method {
|
||||
case UserAuthMethodTypePassword:
|
||||
factors++
|
||||
case UserAuthMethodTypePasswordless:
|
||||
return true
|
||||
case UserAuthMethodTypeU2F:
|
||||
factors++
|
||||
case UserAuthMethodTypeOTP:
|
||||
factors++
|
||||
case UserAuthMethodTypeIDP:
|
||||
case UserAuthMethodTypePassword,
|
||||
UserAuthMethodTypeU2F,
|
||||
UserAuthMethodTypeTOTP,
|
||||
UserAuthMethodTypeOTPSMS,
|
||||
UserAuthMethodTypeOTPEmail,
|
||||
UserAuthMethodTypeIDP:
|
||||
factors++
|
||||
case UserAuthMethodTypeUnspecified,
|
||||
userAuthMethodTypeCount:
|
||||
|
Reference in New Issue
Block a user