From c1adedba8ff9115246bcfa03409ca21e31cd8594 Mon Sep 17 00:00:00 2001 From: Joe <1264204425@qq.com> Date: Mon, 2 Sep 2024 16:25:16 +0800 Subject: [PATCH] feat: update OAuthLogin --- api/controllers/console/auth/oauth.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/api/controllers/console/auth/oauth.py b/api/controllers/console/auth/oauth.py index 28ff69a0b4c8de..10308943fd41c8 100644 --- a/api/controllers/console/auth/oauth.py +++ b/api/controllers/console/auth/oauth.py @@ -42,7 +42,8 @@ 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) @@ -50,7 +51,7 @@ def get(self, provider: str, invite_toke: Optional[str] = None): 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)