mirror of
https://github.com/zitadel/zitadel.git
synced 2025-12-12 10:25:58 +00:00
signin component
This commit is contained in:
@@ -48,6 +48,7 @@
|
||||
"access": "public"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"react": "18.2.0"
|
||||
"react": "18.2.0",
|
||||
"@zitadel/server": "workspace:*"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
31
packages/zitadel-react/src/components/SignInWithIDP.tsx
Normal file
31
packages/zitadel-react/src/components/SignInWithIDP.tsx
Normal file
@@ -0,0 +1,31 @@
|
||||
import * as React from "react";
|
||||
import { ZitadelServer, settings, getActiveIdentityProvidersResponse } from "@zitadel/server";
|
||||
|
||||
export interface SignInWithIDPProps {
|
||||
children?: React.ReactNode;
|
||||
server: ZitadelServer;
|
||||
orgId?: string;
|
||||
}
|
||||
|
||||
function getIDPs(
|
||||
server: ZitadelServer,
|
||||
orgId?: string,
|
||||
): Promise<GetActiveIdentityProvidersResponse | undefined> {
|
||||
const settingsService = settings.getSettings(server);
|
||||
return settingsService
|
||||
.getActiveIdentityProviders(orgId ? {ctx: {orgId}}: {ctx: {instance: true}}, {})
|
||||
.then((resp: getActiveIdentityProvidersResponse) => {
|
||||
return resp.settings;
|
||||
});
|
||||
|
||||
|
||||
export function SignInWithIDP(props: SignInWithIDPProps) {
|
||||
return (
|
||||
<div className="ztdl-flex ztdl-flex-row border ztdl-border-divider-light dark:ztdl-border-divider-dark rounded-md px-4 text-sm">
|
||||
<div></div>
|
||||
{props.children}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
SignInWithIDP.displayName = "SignInWithIDP";
|
||||
@@ -14,3 +14,8 @@ export {
|
||||
ZitadelUIProvider,
|
||||
type ZitadelUIProps,
|
||||
} from "./components/ZitadelUIProvider";
|
||||
|
||||
export {
|
||||
SignInWithIDP,
|
||||
type SignInWithIDPProps,
|
||||
} from "./components/SignInWithIDP";
|
||||
|
||||
Reference in New Issue
Block a user