mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 00:57: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:
@@ -197,7 +197,7 @@ func AuthMethodToPb(mfa *query.AuthMethod) *user_pb.AuthFactor {
|
||||
State: MFAStateToPb(mfa.State),
|
||||
}
|
||||
switch mfa.Type {
|
||||
case domain.UserAuthMethodTypeOTP:
|
||||
case domain.UserAuthMethodTypeTOTP:
|
||||
factor.Type = &user_pb.AuthFactor_Otp{
|
||||
Otp: &user_pb.AuthFactorOTP{},
|
||||
}
|
||||
@@ -208,6 +208,14 @@ func AuthMethodToPb(mfa *query.AuthMethod) *user_pb.AuthFactor {
|
||||
Name: mfa.Name,
|
||||
},
|
||||
}
|
||||
case domain.UserAuthMethodTypeOTPSMS:
|
||||
factor.Type = &user_pb.AuthFactor_OtpSms{
|
||||
OtpSms: &user_pb.AuthFactorOTPSMS{},
|
||||
}
|
||||
case domain.UserAuthMethodTypeOTPEmail:
|
||||
factor.Type = &user_pb.AuthFactor_OtpEmail{
|
||||
OtpEmail: &user_pb.AuthFactorOTPEmail{},
|
||||
}
|
||||
}
|
||||
return factor
|
||||
}
|
||||
|
Reference in New Issue
Block a user