mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-06-12 05:07:40 +02:00
Modify rustfmt file
This commit is contained in:
24
src/auth.rs
24
src/auth.rs
@ -260,7 +260,9 @@ impl<'a, 'r> FromRequest<'a, 'r> for Host {
|
||||
format!("{}://{}", protocol, host)
|
||||
};
|
||||
|
||||
Outcome::Success(Host { host })
|
||||
Outcome::Success(Host {
|
||||
host,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -316,10 +318,8 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers {
|
||||
};
|
||||
|
||||
if user.security_stamp != claims.sstamp {
|
||||
if let Some(stamp_exception) = user
|
||||
.stamp_exception
|
||||
.as_deref()
|
||||
.and_then(|s| serde_json::from_str::<UserStampException>(s).ok())
|
||||
if let Some(stamp_exception) =
|
||||
user.stamp_exception.as_deref().and_then(|s| serde_json::from_str::<UserStampException>(s).ok())
|
||||
{
|
||||
let current_route = match request.route().and_then(|r| r.name) {
|
||||
Some(name) => name,
|
||||
@ -337,7 +337,11 @@ impl<'a, 'r> FromRequest<'a, 'r> for Headers {
|
||||
}
|
||||
}
|
||||
|
||||
Outcome::Success(Headers { host, device, user })
|
||||
Outcome::Success(Headers {
|
||||
host,
|
||||
device,
|
||||
user,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@ -639,10 +643,10 @@ impl<'a, 'r> FromRequest<'a, 'r> for ClientIp {
|
||||
None
|
||||
};
|
||||
|
||||
let ip = ip
|
||||
.or_else(|| req.remote().map(|r| r.ip()))
|
||||
.unwrap_or_else(|| "0.0.0.0".parse().unwrap());
|
||||
let ip = ip.or_else(|| req.remote().map(|r| r.ip())).unwrap_or_else(|| "0.0.0.0".parse().unwrap());
|
||||
|
||||
Outcome::Success(ClientIp { ip })
|
||||
Outcome::Success(ClientIp {
|
||||
ip,
|
||||
})
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user