Can enforce 2FA for specific clients
This commit is contained in:
@@ -20,10 +20,10 @@ impl FromRequest for CriticalRoute {
|
||||
.await
|
||||
.expect("Failed to extract user identity!");
|
||||
|
||||
if current_user.should_request_2fa_for_critical_function() {
|
||||
let url = get_2fa_url(&LoginRedirect::from_req(&req), true);
|
||||
if current_user.should_request_2fa_for_critical_functions() {
|
||||
let uri = get_2fa_url(&LoginRedirect::from_req(&req), true);
|
||||
|
||||
return Err(FromRequestRedirect::new(url));
|
||||
return Err(FromRequestRedirect::new(uri));
|
||||
}
|
||||
|
||||
Ok(Self)
|
||||
|
Reference in New Issue
Block a user