This commit is contained in:
parent
771cbc0888
commit
8d739c6f72
@ -25,8 +25,10 @@ impl FromRequest for Force2FAAuth {
|
||||
|
||||
Box::pin(async move {
|
||||
// It is impossible to force authentication for an unauthenticated user
|
||||
let identity: Option<&Identity> = req.conn_data();
|
||||
if !SessionIdentity(identity).is_authenticated() {
|
||||
let identity = Identity::from_request(&req, &mut Payload::None)
|
||||
.into_inner()
|
||||
.ok();
|
||||
if !SessionIdentity(identity.as_ref()).is_authenticated() {
|
||||
return Ok(Self { force: false });
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user