This commit is contained in:
@@ -14,7 +14,7 @@ from orm.author import Author
|
||||
from resolvers.stat import get_with_stat
|
||||
from services.db import local_session
|
||||
from services.schema import request_graphql_data
|
||||
from settings import ADMIN_SECRET
|
||||
from settings import ADMIN_SECRET, WEBHOOK_SECRET
|
||||
|
||||
|
||||
async def create_webhook_endpoint():
|
||||
@@ -33,14 +33,19 @@ async def create_webhook_endpoint():
|
||||
"event_name": "user.login",
|
||||
"endpoint": "https://core.dscrs.site/new-author",
|
||||
"enabled": True,
|
||||
"headers": {
|
||||
"Authorization": WEBHOOK_SECRET
|
||||
},
|
||||
}
|
||||
}
|
||||
gql = {
|
||||
"query": f"query {operation}($params: AddWebhookRequest!) {{"
|
||||
"query": f"query {operation}($params: AddWebhookRequest!)"
|
||||
+ "{"
|
||||
+ f"{query_name}(params: $params) {{ message }} "
|
||||
+ "}",
|
||||
"variables": variables,
|
||||
"operationName": operation,
|
||||
|
||||
}
|
||||
result = await request_graphql_data(gql, headers=headers)
|
||||
logger.info(result)
|
||||
|
Reference in New Issue
Block a user