sex
This commit is contained in:
parent
2ca75ac5d2
commit
2fb5237d9a
1 changed files with 3 additions and 2 deletions
|
@ -93,6 +93,7 @@ def edit_oauth_app(v, aid):
|
||||||
def admin_app_approve(v, aid):
|
def admin_app_approve(v, aid):
|
||||||
|
|
||||||
app = g.db.query(OauthApp).filter_by(id=aid).first()
|
app = g.db.query(OauthApp).filter_by(id=aid).first()
|
||||||
|
user = app.author
|
||||||
|
|
||||||
app.client_id = secrets.token_urlsafe(64)[:64]
|
app.client_id = secrets.token_urlsafe(64)[:64]
|
||||||
g.db.add(app)
|
g.db.add(app)
|
||||||
|
@ -100,13 +101,13 @@ def admin_app_approve(v, aid):
|
||||||
access_token = secrets.token_urlsafe(128)[:128]
|
access_token = secrets.token_urlsafe(128)[:128]
|
||||||
new_auth = ClientAuth(
|
new_auth = ClientAuth(
|
||||||
oauth_client = app.id,
|
oauth_client = app.id,
|
||||||
user_id = v.id,
|
user_id = user.id,
|
||||||
access_token=access_token
|
access_token=access_token
|
||||||
)
|
)
|
||||||
|
|
||||||
g.db.add(new_auth)
|
g.db.add(new_auth)
|
||||||
|
|
||||||
send_notification(1046, v, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
send_notification(1046, user.id, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.")
|
||||||
|
|
||||||
return {"message": f"{app.app_name} approved"}
|
return {"message": f"{app.app_name} approved"}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue