1
0
Fork 0
forked from alemi/upub

fix: continue as anon if can't fetch user

This commit is contained in:
əlemi 2024-04-13 03:31:37 +02:00
parent c342b7c936
commit d60d29bf98
Signed by: alemi
GPG key ID: A4895B84D311642C

View file

@ -93,7 +93,7 @@ where
};
let user_id = unverified.key_id().replace("#main-key", "");
let user = ctx.fetch().user(&user_id).await?;
if let Ok(user) = ctx.fetch().user(&user_id).await {
let pubkey = PKey::public_key_from_pem(user.public_key.as_bytes())?;
let valid = unverified.verify(|sig, to_sign| {
@ -111,6 +111,7 @@ where
// TODO introduce hardened mode which identifies remotes by user and not server
identity = Identity::Remote(Context::server(&user_id));
}
}
Ok(AuthIdentity(identity))
}