mirror of
https://github.com/aykhans/slash-e.git
synced 2025-04-20 22:07:15 +00:00
fix: auth callback
This commit is contained in:
parent
ea7ea0ac24
commit
db09ac2c5c
@ -34,11 +34,11 @@ const AuthCallback = () => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const idpName = last(state.split("-"));
|
const idpId = last(state.split("-"));
|
||||||
if (!idpName) {
|
if (!idpId) {
|
||||||
setState({
|
setState({
|
||||||
loading: false,
|
loading: false,
|
||||||
errorMessage: "No identity provider name found in the state parameter.",
|
errorMessage: "No identity provider found in the state parameter.",
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -47,7 +47,7 @@ const AuthCallback = () => {
|
|||||||
(async () => {
|
(async () => {
|
||||||
try {
|
try {
|
||||||
await authServiceClient.signInWithSSO({
|
await authServiceClient.signInWithSSO({
|
||||||
idpName,
|
idpId,
|
||||||
code,
|
code,
|
||||||
redirectUri,
|
redirectUri,
|
||||||
});
|
});
|
||||||
|
@ -62,7 +62,7 @@ const SignIn: React.FC = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleSignInWithIdentityProvider = async (identityProvider: IdentityProvider) => {
|
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) {
|
if (identityProvider.type === IdentityProvider_Type.OAUTH2) {
|
||||||
const redirectUri = absolutifyLink("/auth/callback");
|
const redirectUri = absolutifyLink("/auth/callback");
|
||||||
const oauth2Config = identityProvider.config?.oauth2;
|
const oauth2Config = identityProvider.config?.oauth2;
|
||||||
@ -131,7 +131,7 @@ const SignIn: React.FC = () => {
|
|||||||
<div className="w-full flex flex-col space-y-2">
|
<div className="w-full flex flex-col space-y-2">
|
||||||
{workspaceStore.setting.identityProviders.map((identityProvider) => (
|
{workspaceStore.setting.identityProviders.map((identityProvider) => (
|
||||||
<Button
|
<Button
|
||||||
key={identityProvider.name}
|
key={identityProvider.id}
|
||||||
variant="outlined"
|
variant="outlined"
|
||||||
color="neutral"
|
color="neutral"
|
||||||
className="w-full"
|
className="w-full"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user