This commit is contained in:
parent
89550724fd
commit
cbb4064e6d
|
@ -19,7 +19,7 @@ async def check_auth(req) -> (bool, int | None):
|
||||||
# Logging the authentication token
|
# Logging the authentication token
|
||||||
print(f"[services.auth] checking auth token: {token}")
|
print(f"[services.auth] checking auth token: {token}")
|
||||||
query_name = "validate_jwt_token"
|
query_name = "validate_jwt_token"
|
||||||
opeation = "ValidateToken"
|
operation = "ValidateToken"
|
||||||
headers = {
|
headers = {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
}
|
}
|
||||||
|
@ -27,14 +27,14 @@ async def check_auth(req) -> (bool, int | None):
|
||||||
variables = {
|
variables = {
|
||||||
"params": {
|
"params": {
|
||||||
"token_type": "access_token",
|
"token_type": "access_token",
|
||||||
"token": token.encode("utf-8"),
|
"token": token,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gql = {
|
gql = {
|
||||||
"query": f"query {opeation}($params: ValidateJWTTokenInput!) {{ {query_name}(params: $params) {{ is_valid claims }} }}",
|
"query": f"query {operation}($params: ValidateJWTTokenInput!) {{ {query_name}(params: $params) {{ is_valid claims }} }}",
|
||||||
"variables": variables,
|
"variables": variables,
|
||||||
"operationName": opeation,
|
"operationName": operation,
|
||||||
}
|
}
|
||||||
print(f"[services.auth] Graphql: {gql}")
|
print(f"[services.auth] Graphql: {gql}")
|
||||||
try:
|
try:
|
||||||
|
@ -75,6 +75,7 @@ async def check_auth(req) -> (bool, int | None):
|
||||||
def login_required(f):
|
def login_required(f):
|
||||||
@wraps(f)
|
@wraps(f)
|
||||||
async def decorated_function(*args, **kwargs):
|
async def decorated_function(*args, **kwargs):
|
||||||
|
print(args)
|
||||||
info = args[1]
|
info = args[1]
|
||||||
context = info.context
|
context = info.context
|
||||||
req = context.get("request")
|
req = context.get("request")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user