Skip to content

Commit

Permalink
feat: update OAuthLogin
Browse files Browse the repository at this point in the history
  • Loading branch information
ZhouhaoJiang committed Sep 2, 2024
1 parent bb5366c commit c1adedb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/controllers/console/auth/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ def get_oauth_providers():


class OAuthLogin(Resource):
def get(self, provider: str, invite_toke: Optional[str] = None):
def get(self, provider: str):
invite_token = request.args.get("invite_token") or None
OAUTH_PROVIDERS = get_oauth_providers()
with current_app.app_context():
oauth_provider = OAUTH_PROVIDERS.get(provider)
print(vars(oauth_provider))
if not oauth_provider:
return {"error": "Invalid provider"}, 400

auth_url = oauth_provider.get_authorization_url(invite_toke)
auth_url = oauth_provider.get_authorization_url(invite_token=invite_token)
return redirect(auth_url)


Expand Down

0 comments on commit c1adedb

Please sign in to comment.