File tree 2 files changed +15
-5
lines changed
2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -5,7 +5,11 @@ export default async function Home() {
5
5
await redirectIfAuthenticated ( ) ;
6
6
return (
7
7
< main className = "container max-w-lg flex items-center" >
8
- < LogIn isDevMode = { process . env . NODE_ENV === "development" } />
8
+ < LogIn
9
+ isDevMode = { process . env . NODE_ENV === "development" }
10
+ githubEnabled = { ! ! process . env . AUTH_GITHUB_ID }
11
+ entraIdEnabled = { ! ! process . env . AZURE_AD_CLIENT_ID }
12
+ />
9
13
</ main >
10
14
) ;
11
15
}
Original file line number Diff line number Diff line change @@ -14,6 +14,8 @@ import {
14
14
15
15
interface LoginProps {
16
16
isDevMode : boolean ;
17
+ githubEnabled : boolean ;
18
+ entraIdEnabled : boolean ;
17
19
}
18
20
19
21
export const LogIn : FC < LoginProps > = ( props ) => {
@@ -31,13 +33,17 @@ export const LogIn: FC<LoginProps> = (props) => {
31
33
</ CardDescription >
32
34
</ CardHeader >
33
35
< CardContent className = "grid gap-4" >
34
- < Button onClick = { ( ) => signIn ( "github" ) } > GitHub</ Button >
35
- < Button onClick = { ( ) => signIn ( "azure-ad" ) } > Microsoft 365</ Button >
36
- { props . isDevMode ? (
36
+ { props . githubEnabled && (
37
+ < Button onClick = { ( ) => signIn ( "github" ) } > GitHub</ Button >
38
+ ) }
39
+ { props . entraIdEnabled && (
40
+ < Button onClick = { ( ) => signIn ( "azure-ad" ) } > Microsoft 365</ Button >
41
+ ) }
42
+ { props . isDevMode && (
37
43
< Button onClick = { ( ) => signIn ( "localdev" ) } >
38
44
Basic Auth (DEV ONLY)
39
45
</ Button >
40
- ) : null }
46
+ ) }
41
47
</ CardContent >
42
48
</ Card >
43
49
) ;
You can’t perform that action at this time.
0 commit comments