mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-13 11:42:10 +00:00
signin with context
This commit is contained in:
@@ -15,6 +15,7 @@ export interface SignInWithIDPProps {
|
||||
children?: ReactNode;
|
||||
host: string;
|
||||
identityProviders: any[];
|
||||
authRequestId?: string;
|
||||
startIDPFlowPath?: (idpId: string) => string;
|
||||
}
|
||||
|
||||
@@ -24,6 +25,7 @@ const START_IDP_FLOW_PATH = (idpId: string) =>
|
||||
export function SignInWithIDP({
|
||||
host,
|
||||
identityProviders,
|
||||
authRequestId,
|
||||
startIDPFlowPath = START_IDP_FLOW_PATH,
|
||||
}: SignInWithIDPProps) {
|
||||
const [loading, setLoading] = useState<boolean>(false);
|
||||
@@ -40,7 +42,10 @@ export function SignInWithIDP({
|
||||
},
|
||||
body: JSON.stringify({
|
||||
idpId,
|
||||
successUrl: `${host}/idp/${provider}/success`,
|
||||
successUrl: authRequestId
|
||||
? `${host}/idp/${provider}/success?` +
|
||||
new URLSearchParams({ authRequestId })
|
||||
: `${host}/idp/${provider}/success`,
|
||||
failureUrl: `${host}/idp/${provider}/failure`,
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user