1
1
import type { Interpolation , Theme } from "@emotion/react" ;
2
- import Checkbox from "@mui/material/Checkbox" ;
3
- import { type FC , type ReactNode , useState } from "react" ;
2
+ import type { FC , ReactNode } from "react" ;
4
3
import type { AuthMethods } from "api/typesGenerated" ;
5
4
import { Alert } from "components/Alert/Alert" ;
6
5
import { ErrorAlert } from "components/Alert/ErrorAlert" ;
7
6
import { getApplicationName } from "utils/appearance" ;
8
7
import { OAuthSignInForm } from "./OAuthSignInForm" ;
9
8
import { PasswordSignInForm } from "./PasswordSignInForm" ;
10
- import { Link } from "@mui/material" ;
11
9
12
10
export const Language = {
13
11
emailLabel : "Email" ,
@@ -85,10 +83,6 @@ export const SignInForm: FC<SignInFormProps> = ({
85
83
const passwordEnabled = authMethods ?. password . enabled ?? true ;
86
84
const applicationName = getApplicationName ( ) ;
87
85
88
- const [ tosAccepted , setTosAccepted ] = useState ( false ) ;
89
- const termsOfServiceAcceptanceRequired =
90
- authMethods ?. terms_of_service_link && ! tosAccepted ;
91
-
92
86
return (
93
87
< div css = { styles . root } >
94
88
< h1 css = { styles . title } > { applicationName } </ h1 >
@@ -105,55 +99,30 @@ export const SignInForm: FC<SignInFormProps> = ({
105
99
</ div >
106
100
) }
107
101
108
- { ! termsOfServiceAcceptanceRequired && (
109
- < >
110
- { oAuthEnabled && (
111
- < OAuthSignInForm
112
- isSigningIn = { isSigningIn }
113
- redirectTo = { redirectTo }
114
- authMethods = { authMethods }
115
- />
116
- ) }
117
-
118
- { passwordEnabled && oAuthEnabled && (
119
- < div css = { styles . divider } >
120
- < div css = { styles . dividerLine } />
121
- < div css = { styles . dividerLabel } > or</ div >
122
- < div css = { styles . dividerLine } />
123
- </ div >
124
- ) }
125
-
126
- { passwordEnabled && (
127
- < PasswordSignInForm
128
- onSubmit = { onSubmit }
129
- autoFocus = { ! oAuthEnabled }
130
- isSigningIn = { isSigningIn }
131
- />
132
- ) }
133
- </ >
102
+ { oAuthEnabled && (
103
+ < OAuthSignInForm
104
+ isSigningIn = { isSigningIn }
105
+ redirectTo = { redirectTo }
106
+ authMethods = { authMethods }
107
+ />
134
108
) }
135
109
136
- { authMethods ?. terms_of_service_link && (
137
- < div css = { { paddingTop : 8 , fontSize : 14 } } >
138
- < label >
139
- < Checkbox
140
- size = "small"
141
- checked = { tosAccepted }
142
- onChange = { ( event ) => setTosAccepted ( event . target . checked ) }
143
- />
144
- I agree to the{ " " }
145
- < Link
146
- href = { authMethods . terms_of_service_link }
147
- target = "_blank"
148
- rel = "noreferrer"
149
- >
150
- Terms of Service
151
- </ Link >
152
- .
153
- </ label >
110
+ { passwordEnabled && oAuthEnabled && (
111
+ < div css = { styles . divider } >
112
+ < div css = { styles . dividerLine } />
113
+ < div css = { styles . dividerLabel } > or</ div >
114
+ < div css = { styles . dividerLine } />
154
115
</ div >
155
116
) }
156
117
118
+ { passwordEnabled && (
119
+ < PasswordSignInForm
120
+ onSubmit = { onSubmit }
121
+ autoFocus = { ! oAuthEnabled }
122
+ isSigningIn = { isSigningIn }
123
+ />
124
+ ) }
125
+
157
126
{ ! passwordEnabled && ! oAuthEnabled && (
158
127
< Alert severity = "error" > No authentication methods configured!</ Alert >
159
128
) }
0 commit comments