@@ -12,7 +12,6 @@ import { KernLogo } from "@/pkg/ui/Icons"
12
12
import { DemoFlow } from "@/pkg/ui/DemoFlow"
13
13
import { getValueIdentifier , getValuePassword } from "@/util/helper-functions"
14
14
import ory from "@/pkg/sdk"
15
- import { MiscInfo } from "@/services/basic-fetch/misc"
16
15
17
16
const Login : NextPage = ( ) => {
18
17
const [ initialFlow , setInitialFlow ] = useState < LoginFlow > ( ) ;
@@ -75,21 +74,6 @@ const Login: NextPage = () => {
75
74
76
75
const flowData : any = Object . assign ( { } , initialFlow ) ;
77
76
78
- let emailNode = flowData . ui . nodes . find ( ( node : any ) => node . meta ?. label ?. text == "E-Mail" ) ;
79
- if ( emailNode && MiscInfo . isDemo ) {
80
- emailNode . attributes . value = getValueIdentifier ( selectedRole ) ;
81
- }
82
-
83
- let passwordNode = flowData . ui . nodes . find ( ( node : any ) => node . meta ?. label ?. text == "Password" ) ;
84
- if ( passwordNode && MiscInfo . isDemo ) {
85
- passwordNode . attributes . value = getValuePassword ( selectedRole ) ;
86
- }
87
-
88
- let submitNode = flowData . ui . nodes . find ( ( node : any ) => node . meta ?. label ?. text == "Sign in" ) ;
89
- if ( submitNode && MiscInfo . isDemo ) {
90
- submitNode . meta . label . text = "Proceed"
91
- }
92
-
93
77
if ( initialFlow . ui . nodes . some ( ( node : any ) => node . group === "totp" ) ) {
94
78
const totcData = JSON . parse ( JSON . stringify ( flowData ) ) ;
95
79
totcData . ui . nodes = totcData . ui . nodes . filter ( ( node : any ) => node . group == "totp" || node . group == "default" ) ;
@@ -120,11 +104,7 @@ const Login: NextPage = () => {
120
104
window . location . href = initialFlow ?. return_to
121
105
return
122
106
}
123
- if ( MiscInfo . isManaged ) {
124
- router . push ( "/cognition" )
125
- } else {
126
- router . push ( "/refinery/projects" )
127
- }
107
+ router . push ( "/cognition" )
128
108
129
109
} )
130
110
. then ( ( ) => { } )
@@ -149,60 +129,31 @@ const Login: NextPage = () => {
149
129
< div className = "app-container" >
150
130
< KernLogo />
151
131
< div id = "login" >
152
- < h2 className = "title" > { MiscInfo . isDemo ? 'Proceed with your selected role' : 'Sign in to your account' } </ h2 >
153
- { ! MiscInfo . isDemo ? (
154
- < > { MiscInfo . isManaged ? (
155
- < p className = "text-paragraph" > Or
156
- < a className = "link" data-testid = "cta-link" href = "/auth/registration" > Register account </ a > -
157
- no credit card required!
158
- </ p >
159
- ) : ( < >
160
- < p className = "text-paragraph" > You don't have an account yet?
161
- < a className = "link" data-testid = "cta-link" href = "/auth/registration" > Sign up here (local)</ a >
162
- </ p >
163
- </ > ) } </ >
164
- ) : ( < > </ > ) }
132
+ < h2 className = "title" > Sign in to your account</ h2 >
133
+ < p className = "text-paragraph" > Or
134
+ < a className = "link" data-testid = "cta-link" href = "/auth/registration" > Register account </ a > -
135
+ no credit card required!
136
+ </ p >
165
137
< div className = "ui-container" >
166
- { ! MiscInfo . isDemo ? (
167
- < div >
168
- < Flow onSubmit = { onSubmit } flow = { changedFlow } only = "password" />
169
- { oidcFlow ?
170
- < >
171
- < div className = "divider-outer" > < span className = "divider" > Or</ span > </ div >
172
- < Flow onSubmit = { onSubmit } flow = { oidcFlow } only = "oidc" />
173
- </ > : null }
174
- { totpFlow ?
175
- < >
176
- < Flow onSubmit = { onSubmit } flow = { totpFlow } only = "totp" />
177
- </ > : null }
178
- </ div > ) : ( < >
179
-
180
- < fieldset >
181
- < span className = "typography-h3" >
182
- Select role
183
- < span className = "required-indicator" > *</ span >
184
- < select className = "typography-h3 select" id = "roles" value = { selectedRole } onChange = { ( e : any ) => { setSelectedRole ( e . target . value ) ; } } >
185
- < option value = "engineer" > Engineer</ option >
186
- < option value = "expert" > Expert</ option >
187
- < option value = "annotator" > Annotator</ option >
188
- </ select >
189
- </ span >
190
- </ fieldset >
191
- < p className = "text-description" id = "description" >
192
- { selectedRole === 'engineer' ? 'Administers the project and works on programmatic tasks such as labeling automation or filter settings.' : selectedRole === 'expert' ? 'Working on reference manual labels, which can be used by the engineering team to estimate the data quality.' : 'Working on manual labels as if they were heuristics. They can be switched on/off by the engineering team, so that the engineers can in - or exclude them during weak supervision.' }
193
- </ p >
194
- < p className = "text-description" id = "sub-description" >
195
- { selectedRole === 'engineer' ? 'They have access to all features of the application, including the Python SDK.' : selectedRole === 'expert' ? 'They have access to the labeling view only.' : 'They have access to a task-minimized labeling view only. Engineers can revoke their access to the labeling view.' }
196
- </ p >
197
- < DemoFlow onSubmit = { onSubmit } flow = { changedFlow } />
198
- </ > ) }
138
+ < div >
139
+ < Flow onSubmit = { onSubmit } flow = { changedFlow } only = "password" />
140
+ { oidcFlow ?
141
+ < >
142
+ < div className = "divider-outer" > < span className = "divider" > Or</ span > </ div >
143
+ < Flow onSubmit = { onSubmit } flow = { oidcFlow } only = "oidc" />
144
+ </ > : null }
145
+ { totpFlow ?
146
+ < >
147
+ < Flow onSubmit = { onSubmit } flow = { totpFlow } only = "totp" />
148
+ </ > : null }
149
+ </ div >
199
150
</ div >
200
151
< div className = "link-container" >
201
- { ! MiscInfo . isDemo ?
152
+ {
202
153
! isAccLinkageRequested ?
203
154
< a className = "link" data-testid = "forgot-password" href = "/auth/recovery" > Forgot your password?</ a >
204
155
: < a className = "link" data-testid = "back-to-login" href = "/auth/login" > Go back to login</ a >
205
- : null }
156
+ }
206
157
</ div >
207
158
</ div >
208
159
</ div >
0 commit comments