File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,14 @@ export const AppRouter: React.FC = () => (
34
34
35
35
< Route path = "login" element = { < LoginPage /> } />
36
36
< Route path = "healthz" element = { < HealthzPage /> } />
37
- < Route path = "cli-auth" element = { < CliAuthenticationPage /> } />
37
+ < Route
38
+ path = "cli-auth"
39
+ element = {
40
+ < RequireAuth >
41
+ < CliAuthenticationPage />
42
+ </ RequireAuth >
43
+ }
44
+ />
38
45
39
46
< Route path = "templates" >
40
47
< Route
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ const useStyles = makeStyles((theme) => ({
53
53
54
54
export interface SignInFormProps {
55
55
isLoading : boolean
56
+ redirectTo : string
56
57
authErrorMessage ?: string
57
58
methodsErrorMessage ?: string
58
59
authMethods ?: AuthMethods
@@ -61,6 +62,7 @@ export interface SignInFormProps {
61
62
62
63
export const SignInForm : React . FC < SignInFormProps > = ( {
63
64
authMethods,
65
+ redirectTo,
64
66
isLoading,
65
67
authErrorMessage,
66
68
methodsErrorMessage,
@@ -113,7 +115,7 @@ export const SignInForm: React.FC<SignInFormProps> = ({
113
115
</ form >
114
116
{ authMethods ?. github && (
115
117
< div className = { styles . submitBtn } >
116
- < Link href = " /api/v2/users/oauth2/github/callback" >
118
+ < Link href = { ` /api/v2/users/oauth2/github/callback?redirect= ${ encodeURIComponent ( redirectTo ) } ` } >
117
119
< Button color = "primary" disabled = { isLoading } fullWidth type = "submit" variant = "contained" >
118
120
{ Language . githubSignIn }
119
121
</ Button >
Original file line number Diff line number Diff line change @@ -52,6 +52,7 @@ export const LoginPage: React.FC = () => {
52
52
< div className = { styles . container } >
53
53
< SignInForm
54
54
authMethods = { authState . context . methods }
55
+ redirectTo = { redirectTo }
55
56
isLoading = { isLoading }
56
57
authErrorMessage = { authErrorMessage }
57
58
methodsErrorMessage = { getMethodsError }
You can’t perform that action at this time.
0 commit comments