Skip to content

Commit

Permalink
fix: auth callback
Browse files Browse the repository at this point in the history
  • Loading branch information
boojack committed Aug 12, 2024
1 parent ea7ea0a commit db09ac2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions frontend/web/src/pages/AuthCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const AuthCallback = () => {
return;
}

const idpName = last(state.split("-"));
if (!idpName) {
const idpId = last(state.split("-"));
if (!idpId) {
setState({
loading: false,
errorMessage: "No identity provider name found in the state parameter.",
errorMessage: "No identity provider found in the state parameter.",
});
return;
}
Expand All @@ -47,7 +47,7 @@ const AuthCallback = () => {
(async () => {
try {
await authServiceClient.signInWithSSO({
idpName,
idpId,
code,
redirectUri,
});
Expand Down
4 changes: 2 additions & 2 deletions frontend/web/src/pages/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ const SignIn: React.FC = () => {
};

const handleSignInWithIdentityProvider = async (identityProvider: IdentityProvider) => {
const stateQueryParameter = `auth.signin.${identityProvider.title}-${identityProvider.name}`;
const stateQueryParameter = `auth.signin.${identityProvider.title}-${identityProvider.id}`;
if (identityProvider.type === IdentityProvider_Type.OAUTH2) {
const redirectUri = absolutifyLink("/auth/callback");
const oauth2Config = identityProvider.config?.oauth2;
Expand Down Expand Up @@ -131,7 +131,7 @@ const SignIn: React.FC = () => {
<div className="w-full flex flex-col space-y-2">
{workspaceStore.setting.identityProviders.map((identityProvider) => (
<Button
key={identityProvider.name}
key={identityProvider.id}
variant="outlined"
color="neutral"
className="w-full"
Expand Down

0 comments on commit db09ac2

Please sign in to comment.