idp components

This commit is contained in:
peintnermax
2023-07-26 09:30:39 +02:00
parent 70d04c8085
commit d3911c34de
10 changed files with 1747 additions and 1809 deletions

2
.gitignore vendored
View File

@@ -17,3 +17,5 @@ packages/zitadel-server/src/app/proto
packages/zitadel-client/src/app/proto
.vscode
.idea
.vercel
.env*.local

View File

@@ -50,19 +50,49 @@ export async function SignInWithIDP(props: SignInWithIDPProps) {
identityProviders.map((idp, i) => {
switch (idp.type) {
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_GITHUB:
return <SignInWithGithub key={`idp-${i}`}></SignInWithGithub>;
return (
<SignInWithGithub
key={`idp-${i}`}
name={idp.name}
></SignInWithGithub>
);
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_GITHUB_ES:
return <SignInWithGithub key={`idp-${i}`}></SignInWithGithub>;
return (
<SignInWithGithub
key={`idp-${i}`}
name={idp.name}
></SignInWithGithub>
);
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_AZURE_AD:
return <SignInWithAzureAD key={`idp-${i}`}></SignInWithAzureAD>;
return (
<SignInWithAzureAD
key={`idp-${i}`}
name={idp.name}
></SignInWithAzureAD>
);
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_GOOGLE:
return <SignInWithGoogle key={`idp-${i}`}></SignInWithGoogle>;
return (
<SignInWithGoogle
key={`idp-${i}`}
name={idp.name}
></SignInWithGoogle>
);
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_GITLAB:
return <SignInWithGitlab key={`idp-${i}`}></SignInWithGitlab>;
return (
<SignInWithGitlab
key={`idp-${i}`}
name={idp.name}
></SignInWithGitlab>
);
case IdentityProviderType.IDENTITY_PROVIDER_TYPE_GITLAB_SELF_HOSTED:
return <SignInWithGitlab key={`idp-${i}`}></SignInWithGitlab>;
return (
<SignInWithGitlab
key={`idp-${i}`}
name={idp.name}
></SignInWithGitlab>
);
default:
return <div></div>;
return <div>{idp.name}</div>;
}
})}
{props.children}

View File

@@ -1,12 +1,9 @@
{
"extends": [
"//"
],
"extends": ["//"],
"pipeline": {
"build": {
"outputs": [
"dist/**"
]
"outputs": ["dist/**"],
"dependsOn": ["@zitadel/react#build"]
}
}
}
}

View File

@@ -1,3 +1,4 @@
export interface SignInWithIdentityProviderProps {
children?: React.ReactNode;
name?: string;
}

View File

@@ -32,7 +32,9 @@ export function SignInWithAzureAD(props: SignInWithAzureADProps) {
/>
</svg>
</div>
<span className="ztdl-ml-4">Sign in with AzureAD</span>
<span className="ztdl-ml-4">
{props.name ? props.name : "Sign in with AzureAD"}
</span>
</div>
);
}

View File

@@ -1,4 +1,3 @@
import * as React from "react";
import { SignInWithIdentityProviderProps } from "./SignInWith";
export interface SignInWithGithubProps
@@ -33,7 +32,9 @@ export function SignInWithGithub(props: SignInWithGithubProps) {
/>
</svg>
</div>
<span className="ztdl-ml-4">Sign in with Github</span>
<span className="ztdl-ml-4">
{props.name ? props.name : "Sign in with Github"}
</span>
</div>
);
}

View File

@@ -32,7 +32,9 @@ export function SignInWithGitlab(props: SignInWithGitlabProps) {
/>
</svg>
</div>
<span className="ztdl-ml-4">Sign in with Gitlab</span>
<span className="ztdl-ml-4">
{props.name ? props.name : "Sign in with Gitlab"}
</span>
</div>
);
}

View File

@@ -1,4 +1,3 @@
import * as React from "react";
import { SignInWithIdentityProviderProps } from "./SignInWith";
export interface SignInWithGoogleProps
@@ -49,7 +48,9 @@ export function SignInWithGoogle(props: SignInWithGoogleProps) {
/>
</svg>
</div>
<span className="ztdl-ml-4">Sign in with Google</span>
<span className="ztdl-ml-4">
{props.name ? props.name : "Sign in with Google"}
</span>
</div>
);
}

View File

@@ -1,12 +1,8 @@
{
"extends": [
"//"
],
"extends": ["//"],
"pipeline": {
"build": {
"outputs": [
"dist/**"
]
"outputs": ["dist/**"]
}
}
}
}

3470
pnpm-lock.yaml generated

File diff suppressed because it is too large Load Diff