Skip to content

Commit 3c5d55f

Browse files
authored
Update LoginPage.tsx
Updated Options for both Cloud and SH OAuth
1 parent 0dc11fc commit 3c5d55f

File tree

1 file changed

+30
-6
lines changed

1 file changed

+30
-6
lines changed

src/webapp/features/auth/LoginPage.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ import { useState } from "react";
44
import { Link, useSearchParams } from "react-router-dom";
55
import { DataResidency } from "./DataResidency";
66
import { LegalNotice } from "./LegalNotice";
7+
import { isManagedCloud } from "@features/env";
8+
import { isOAuthEnabled } from "@features/env";
9+
import { Button } from "@components/Button";
10+
import { TextInput } from "@components/TextInput";
711
import { Logo } from "./Logo";
812
import { RegionSwitch } from "./RegionSwitch";
13+
import { SignInWithGitHub } from "./SignInWithGitHub";
14+
import { SignInWithGoogle } from "./SignInWithGoogle";
915
import { SignInWithAuthentik } from "./SignInWithAuthentik";
1016

1117
type FormStatus = "idle" | "loading" | "success" | "notfound";
@@ -79,24 +85,42 @@ export function Component() {
7985
</div>
8086
<div className="mt-8 sm:mx-auto sm:w-full sm:max-w-md">
8187
<div className="py-8 px-4 sm:rounded-lg sm:px-10">
82-
{/* {isOAuthEnabled && ( */}
88+
{!isManagedCloud && (
8389
<>
8490
<div className="space-y-2">
8591
<SignInWithAuthentik />
8692
</div>
8793

88-
{/* <div className="relative my-4">
94+
{ <div className="relative my-4">
8995
<div className="absolute inset-0 flex items-center" aria-hidden="true">
9096
<div className="w-full border-t" />
9197
</div>
9298
<div className="relative flex justify-center text-sm">
9399
<span className="px-2 bg-muted">OR</span>
94100
</div>
95-
</div> */}
101+
</div> }
96102
</>
97-
{/* )} */}
103+
)}
104+
105+
{isOAuthEnabled && (
106+
<>
107+
<div className="space-y-2">
108+
<SignInWithGitHub />
109+
<SignInWithGoogle />
110+
</div>
111+
112+
<div className="relative my-4">
113+
<div className="absolute inset-0 flex items-center" aria-hidden="true">
114+
<div className="w-full border-t" />
115+
</div>
116+
<div className="relative flex justify-center text-sm">
117+
<span className="px-2 bg-muted">OR</span>
118+
</div>
119+
</div>
120+
</>
121+
)}
98122

99-
{/* <form onSubmit={handleSubmit} className="flex flex-col space-y-4">
123+
{ <form onSubmit={handleSubmit} className="flex flex-col space-y-4">
100124
<TextInput
101125
label="Enter your email address"
102126
name="email"
@@ -111,7 +135,7 @@ export function Component() {
111135
<p className="text-center text-sm h-10 text-muted-foreground">
112136
<StatusMessage status={status} />
113137
</p>
114-
</form> */}
138+
</form> }
115139
</div>
116140
<LegalNotice operation="signin" />
117141
<RegionSwitch />

0 commit comments

Comments
 (0)