feat: admin list

This commit is contained in:
2024-10-04 18:00:37 +01:00
parent d7b332905b
commit 2b194ad10c
19 changed files with 395 additions and 29 deletions

View File

@ -18,7 +18,7 @@ impl<'r> FromRequest<'r> for Nip98Auth {
type Error = &'static str;
async fn from_request(request: &'r Request<'_>) -> Outcome<Self, Self::Error> {
return if let Some(auth) = request.headers().get_one("authorization") {
if let Some(auth) = request.headers().get_one("authorization") {
if auth.starts_with("Nostr ") {
let event = if let Ok(j) = BASE64_STANDARD.decode(&auth[6..]) {
if let Ok(ev) = Event::from_json(j) {
@ -103,6 +103,6 @@ impl<'r> FromRequest<'r> for Nip98Auth {
}
} else {
Outcome::Error((Status::new(403), "Auth header not found"))
};
}
}
}