CMY6YHG36OX27OCWAENW2FQ3AKBR52XY3OBLKG5RY3D62UZ4BGUQC
JJQ4LMUMVDJV373KTSO74ATGEBCE5FR5L7WSC2UHIFMGLIJZYEDAC
SZIYDOFDBT2H224T5Y6WGL6TFIKOMKGPS7T3NCGVFN7EQOLIHA6AC
Z63HIZPS4WOEDXVLOLVIHNZI2IMXCFCFBIHHM65EQ7SGJRX6BVCAC
TWIZ7QV4GCTQK743IKZSOJCIAEX62GZHFIYGOIFCFGIBOGPSY2WAC
KFVJ3KMWXEGILN4NWIWPPX7AU65M4H4UEAUIAQL2QSXOW3B5RFGQC
5UNA2DEALCSRBINR27KSA6OMD6GQAXHYZ35ICQ7NB62G2XP4FT5QC
W3M3C7CCWHJWRWHULDWO45D3OFD4NL3V4OTJVIJCYRQG57Z2JTWQC
K4JNAJOFEJLHHWP6YSCC2U3CNK3ZPPX6EMBAVQG4VRPZWZRXMPCQC
FS2NWBVN2SZB2FFPB3JSYT5URTVZEAZWMQ7QW4JUYPNJVDVAJTTQC
async fn user_from_basic_auth(db: &State<Database>, req: &Request<'_>) -> Option<User> {
use rocket_basicauth::BasicAuth;
info!("trying basic auth");
let credentials = match BasicAuth::from_request(req).await {
Outcome::Success(ba) => ba,
_ => return None,
};
info!("extracted basic auth");
match User::authenticate(db, credentials.username, credentials.password).await {
Ok(some) => some,
_ => None,
}
}