add: developer panel
This commit is contained in:
parent
ebded00fd3
commit
39574df691
44 changed files with 982 additions and 84 deletions
|
@ -100,19 +100,14 @@ macro_rules! get_user_from_token {
|
|||
}};
|
||||
|
||||
($jar:ident, $db:expr, $grant_scope:expr) => {{
|
||||
if let Some(token) = $jar.get("Atto-Grant")
|
||||
&& let Some(verifier) = $jar.get("Atto-Grant-Verifier")
|
||||
{
|
||||
if let Some(token) = $jar.get("Atto-Grant") {
|
||||
// grant token
|
||||
let verifier = verifier.to_string().replace("Atto-Grant-Verifier=", "");
|
||||
match $db
|
||||
.get_user_by_grant_token(&token.to_string().replace("Atto-Grant=", ""))
|
||||
.get_user_by_grant_token(&token.to_string().replace("Atto-Grant=", ""), true)
|
||||
.await
|
||||
{
|
||||
Ok((grant, ua)) => {
|
||||
if grant.scopes.contains(&$grant_scope)
|
||||
&& grant.check_verifier(&verifier).is_ok()
|
||||
{
|
||||
if grant.scopes.contains(&$grant_scope) {
|
||||
if ua.permissions.check_banned() {
|
||||
Some(tetratto_core::model::auth::User::banned())
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue