forked from rDrama/rDrama
remove code that wasnt working
parent
9872aee7b9
commit
7848587136
|
@ -31,13 +31,8 @@ def authorize(v):
|
|||
return {"oauth_error": "Invalid `client_id`"}, 400
|
||||
access_token = secrets.token_urlsafe(128)[:128]
|
||||
|
||||
try:
|
||||
new_auth = ClientAuth(oauth_client = application.id, user_id = v.id, access_token=access_token)
|
||||
g.db.add(new_auth)
|
||||
except sqlalchemy.exc.IntegrityError:
|
||||
g.db.rollback()
|
||||
old_auth = g.db.query(ClientAuth).filter_by(oauth_client = application.id, user_id = v.id).one()
|
||||
access_token = old_auth.access_token
|
||||
new_auth = ClientAuth(oauth_client = application.id, user_id = v.id, access_token=access_token)
|
||||
g.db.add(new_auth)
|
||||
|
||||
return redirect(f"{application.redirect_uri}?token={access_token}")
|
||||
|
||||
|
|
Loading…
Reference in New Issue