diff --git a/api/controllers/console/auth/oauth.py b/api/controllers/console/auth/oauth.py index 07b9a9d091d40b..ef072c2c5dea89 100644 --- a/api/controllers/console/auth/oauth.py +++ b/api/controllers/console/auth/oauth.py @@ -12,14 +12,14 @@ from events.tenant_event import tenant_was_created from extensions.ext_database import db from libs.helper import extract_remote_ip -from libs.oauth import GitHubOAuth, GoogleOAuth, OAuthUserInfo, AceDataOAuth +from libs.oauth import AceDataOAuth, GitHubOAuth, GoogleOAuth, OAuthUserInfo from models import Account from models.account import AccountStatus from services.account_service import AccountService, RegisterService, TenantService from services.errors.account import AccountNotFoundError from services.errors.workspace import WorkSpaceNotAllowedCreateError, WorkSpaceNotFoundError from services.feature_service import FeatureService -import json + from .. import api diff --git a/api/libs/oauth.py b/api/libs/oauth.py index f7cc23af5d3c47..722157d546da31 100644 --- a/api/libs/oauth.py +++ b/api/libs/oauth.py @@ -141,14 +141,14 @@ class AceDataOAuth(OAuth): def get_authorization_url(self, invite_token: Optional[str] = None): params = { - "site" : "https://dify.acedata.cloud/", - "redirect" : self.redirect_uri, + "site": "https://dify.acedata.cloud/", + "redirect": self.redirect_uri, } return f"https://auth.acedata.cloud/auth/login?{urllib.parse.urlencode(params)}" def get_access_token(self, code: str): data = { - "code" : code + "code": code } headers = {"Accept": "application/json"} response = requests.post(self._TOKEN_URL, data=data, headers=headers)