Skip to content

Commit

Permalink
fix acedata login
Browse files Browse the repository at this point in the history
  • Loading branch information
JunXu01 committed Nov 16, 2024
1 parent 635818c commit d280741
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions api/controllers/console/auth/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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


Expand Down
6 changes: 3 additions & 3 deletions api/libs/oauth.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit d280741

Please sign in to comment.