add: better app data queries
This commit is contained in:
parent
9f61d9ce6a
commit
22aea48cc5
12 changed files with 175 additions and 60 deletions
|
@ -422,12 +422,9 @@ macro_rules! ignore_users_gen {
|
|||
|
||||
#[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
|
||||
{
|
||||
($db:ident, $headers:ident) => {
|
||||
if let Some(token) = $headers.get("Atto-Secret-Key") {
|
||||
match $db.get_app_by_api_key(token.to_str().unwrap()).await {
|
||||
Ok(x) => Some(x),
|
||||
Err(_) => None,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue