0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2024-12-30 20:33:54 -05:00

fix(experience): fix get sso connectors bug

gix get sso connectors bug
This commit is contained in:
simeng-li 2024-08-05 10:15:31 +08:00
parent dea41c96e8
commit 17534fcd27
No known key found for this signature in database
GPG key ID: 14EA7BB1541E8075
3 changed files with 4 additions and 4 deletions

View file

@ -206,7 +206,7 @@ export const getSsoConnectors = async (email: string) =>
email, email,
}, },
}) })
.json<string[]>(); .json<{ connectorIds: string[] }>();
export const getSsoAuthorizationUrl = async (connectorId: string, payload: unknown) => { export const getSsoAuthorizationUrl = async (connectorId: string, payload: unknown) => {
await initInteraction(InteractionEvent.SignIn); await initInteraction(InteractionEvent.SignIn);

View file

@ -56,8 +56,8 @@ const useCheckSingleSignOn = () => {
return; return;
} }
const connectors = result const connectors = result?.connectorIds
?.map((connectorId) => availableSsoConnectorsMap.get(connectorId)) .map((connectorId) => availableSsoConnectorsMap.get(connectorId))
// eslint-disable-next-line unicorn/prefer-native-coercion-functions -- make the type more specific // eslint-disable-next-line unicorn/prefer-native-coercion-functions -- make the type more specific
.filter((connector): connector is SsoConnectorMetadata => Boolean(connector)); .filter((connector): connector is SsoConnectorMetadata => Boolean(connector));

View file

@ -43,7 +43,7 @@ const useSingleSignOnWatch = (identifierInput?: IdentifierInputValue) => {
return false; return false;
} }
const connectors = result const connectors = result.connectorIds
.map((connectorId) => availableSsoConnectorsMap.get(connectorId)) .map((connectorId) => availableSsoConnectorsMap.get(connectorId))
// eslint-disable-next-line unicorn/prefer-native-coercion-functions -- make the type more specific // eslint-disable-next-line unicorn/prefer-native-coercion-functions -- make the type more specific
.filter((connector): connector is SsoConnectorMetadata => Boolean(connector)); .filter((connector): connector is SsoConnectorMetadata => Boolean(connector));