File tree Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Expand file tree Collapse file tree 1 file changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -33,6 +33,10 @@ export default function UserProfile() {
33
33
) ;
34
34
}
35
35
36
+ function handleOIDCLogin ( ) {
37
+ window . location . href = `${ import . meta. env . VITE_API_URI } /api/auth/oidc` ;
38
+ }
39
+
36
40
function handleSubmit ( event ) {
37
41
setIsLoading ( true ) ;
38
42
axios
@@ -104,7 +108,7 @@ export default function UserProfile() {
104
108
width = { '150px' }
105
109
src = { logo }
106
110
alt = 'logo'
107
- data-test = " git-proxy-logo"
111
+ data-test = ' git-proxy-logo'
108
112
/>
109
113
</ div >
110
114
</ CardHeader >
@@ -119,7 +123,7 @@ export default function UserProfile() {
119
123
value = { username }
120
124
onChange = { ( e ) => setUsername ( e . target . value ) }
121
125
autoFocus = { true }
122
- data-test = 'username'
126
+ data-test = 'username'
123
127
/>
124
128
</ FormControl >
125
129
</ GridItem >
@@ -133,17 +137,28 @@ export default function UserProfile() {
133
137
type = 'password'
134
138
value = { password }
135
139
onChange = { ( e ) => setPassword ( e . target . value ) }
136
- data-test = 'password'
140
+ data-test = 'password'
137
141
/>
138
142
</ FormControl >
139
143
</ GridItem >
140
144
</ GridContainer >
141
145
</ CardBody >
142
146
< CardFooter >
143
147
{ ! isLoading ? (
144
- < Button color = 'success' block disabled = { ! validateForm ( ) } type = 'submit' data-test = "login" >
145
- Login
146
- </ Button >
148
+ < >
149
+ < Button
150
+ color = 'success'
151
+ block
152
+ disabled = { ! validateForm ( ) }
153
+ type = 'submit'
154
+ data-test = 'login'
155
+ >
156
+ Login
157
+ </ Button >
158
+ < Button color = 'warning' block onClick = { handleOIDCLogin } data-test = 'oidc-login' >
159
+ Login with OIDC
160
+ </ Button >
161
+ </ >
147
162
) : (
148
163
< div style = { { textAlign : 'center' , width : '100%' , opacity : 0.5 , color : 'green' } } >
149
164
< CircularProgress color = 'inherit' />
You can’t perform that action at this time.
0 commit comments