add: app_data api
This commit is contained in:
parent
5c520f4308
commit
f423daf2fc
38 changed files with 410 additions and 91 deletions
|
@ -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
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue