-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(users): Create generate recovery codes API #4708
Conversation
@@ -68,8 +68,10 @@ pub enum UserErrors { | |||
RoleNameAlreadyExists, | |||
#[error("TOTPNotSetup")] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also should be Totp
considering below two
crates/router/src/core/user.rs
Outdated
@@ -1631,7 +1631,7 @@ pub async fn begin_totp( | |||
})); | |||
} | |||
|
|||
let totp = utils::user::generate_default_totp(user_from_db.get_email(), None)?; | |||
let totp = utils::user::two_fa::generate_default_totp(user_from_db.get_email(), None)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better if we call this function two_factor_authentication
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a module and I feel it will be too big for a file name.
Opinions @racnan
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
two_factor_auth
?
Type of Change
Description
Currently recovery code are being generated in
begin_totp
API. We want to make a separate out recovery codes and TOTP, so this PR creates a new API which generates the recovery codes.This API will also be used to regenerate recovery codes later.
Additional Changes
Motivation and Context
This is a sub part of #4707
How did you test it?
This can only be tested locally as it requires some changes in the redis.
Checklist
cargo +nightly fmt --all
cargo clippy