add: app_data api

This commit is contained in:
trisua 2025-07-17 13:34:10 -04:00
parent 5c520f4308
commit f423daf2fc
38 changed files with 410 additions and 91 deletions

View file

@ -419,3 +419,20 @@ macro_rules! ignore_users_gen {
.concat()
};
}
#[macro_export]
macro_rules! get_app_from_key {
($db:ident, $jar:ident) => {
if let Some(token) = $jar.get("Atto-Secret-Key") {
match $db
.get_app_by_api_key(&token.to_string().replace("Atto-Secret-Key=", ""))
.await
{
Ok(x) => Some(x),
Err(_) => None,
}
} else {
None
}
};
}