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