Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix auto login #1362

Merged
merged 6 commits into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions backend/chainlit/oauth_providers.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def __init__(self):
self.client_secret = os.environ.get("OAUTH_GITHUB_CLIENT_SECRET")
self.authorize_params = {
"scope": "user:email",
"prompt": "consent",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -95,6 +96,7 @@ def __init__(self):
"scope": "https://www.googleapis.com/auth/userinfo.profile https://www.googleapis.com/auth/userinfo.email",
"response_type": "code",
"access_type": "offline",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -162,6 +164,7 @@ def __init__(self):
"response_type": "code",
"scope": "https://graph.microsoft.com/User.Read",
"response_mode": "query",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -246,6 +249,7 @@ def __init__(self):
"scope": "https://graph.microsoft.com/User.Read https://graph.microsoft.com/openid",
"response_mode": "form_post",
"nonce": nonce,
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -325,6 +329,7 @@ def __init__(self):
"response_type": "code",
"scope": "openid profile email",
"response_mode": "query",
"prompt": "login",
}

def get_authorization_server_path(self):
Expand Down Expand Up @@ -396,6 +401,7 @@ def __init__(self):
"response_type": "code",
"scope": "openid profile email",
"audience": f"{self.original_domain}/userinfo",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -453,6 +459,7 @@ def __init__(self):
"response_type": "code",
"scope": "openid profile email",
"audience": f"{self.domain}/userinfo",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -511,6 +518,7 @@ def __init__(self):
"response_type": "code",
"client_id": self.client_id,
"scope": "openid profile email",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down Expand Up @@ -579,6 +587,7 @@ def __init__(self):
self.authorize_params = {
"scope": "openid profile email",
"response_type": "code",
"prompt": "login",
}

async def get_token(self, code: str, url: str):
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/molecules/auth/AuthLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ const AuthLogin = ({
setErrorState(undefined);
formik.resetForm();
}, [showSignIn]);

useEffect(() => {
setErrorState(error);
}, [error]);
Expand Down
Loading