tangled
alpha
login
or
join now
isuggest.selfce.st
/
strand
3
fork
atom
alternative tangled frontend (extremely wip)
3
fork
atom
overview
issues
pulls
pipelines
refactor: reorg routes
serenity
3 weeks ago
f6558e01
dafc272a
+78
-40
5 changed files
expand all
collapse all
unified
split
src
routeTree.gen.ts
routes
_authed
oauth
callback.tsx
_authed.tsx
index.tsx
login.tsx
+61
-37
src/routeTree.gen.ts
···
9
9
// Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified.
10
10
11
11
import { Route as rootRouteImport } from './routes/__root'
12
12
+
import { Route as LoginRouteImport } from './routes/login'
13
13
+
import { Route as AuthedRouteImport } from './routes/_authed'
12
14
import { Route as IndexRouteImport } from './routes/index'
13
13
-
import { Route as ReservedLoginRouteImport } from './routes/reserved/login'
14
14
-
import { Route as ReservedOauthCallbackRouteImport } from './routes/reserved/oauth/callback'
15
15
+
import { Route as AuthedOauthCallbackRouteImport } from './routes/_authed/oauth/callback'
15
16
17
17
+
const LoginRoute = LoginRouteImport.update({
18
18
+
id: '/login',
19
19
+
path: '/login',
20
20
+
getParentRoute: () => rootRouteImport,
21
21
+
} as any)
22
22
+
const AuthedRoute = AuthedRouteImport.update({
23
23
+
id: '/_authed',
24
24
+
getParentRoute: () => rootRouteImport,
25
25
+
} as any)
16
26
const IndexRoute = IndexRouteImport.update({
17
27
id: '/',
18
28
path: '/',
19
29
getParentRoute: () => rootRouteImport,
20
30
} as any)
21
21
-
const ReservedLoginRoute = ReservedLoginRouteImport.update({
22
22
-
id: '/reserved/login',
23
23
-
path: '/reserved/login',
24
24
-
getParentRoute: () => rootRouteImport,
25
25
-
} as any)
26
26
-
const ReservedOauthCallbackRoute = ReservedOauthCallbackRouteImport.update({
27
27
-
id: '/reserved/oauth/callback',
28
28
-
path: '/reserved/oauth/callback',
29
29
-
getParentRoute: () => rootRouteImport,
31
31
+
const AuthedOauthCallbackRoute = AuthedOauthCallbackRouteImport.update({
32
32
+
id: '/oauth/callback',
33
33
+
path: '/oauth/callback',
34
34
+
getParentRoute: () => AuthedRoute,
30
35
} as any)
31
36
32
37
export interface FileRoutesByFullPath {
33
38
'/': typeof IndexRoute
34
34
-
'/reserved/login': typeof ReservedLoginRoute
35
35
-
'/reserved/oauth/callback': typeof ReservedOauthCallbackRoute
39
39
+
'/login': typeof LoginRoute
40
40
+
'/oauth/callback': typeof AuthedOauthCallbackRoute
36
41
}
37
42
export interface FileRoutesByTo {
38
43
'/': typeof IndexRoute
39
39
-
'/reserved/login': typeof ReservedLoginRoute
40
40
-
'/reserved/oauth/callback': typeof ReservedOauthCallbackRoute
44
44
+
'/login': typeof LoginRoute
45
45
+
'/oauth/callback': typeof AuthedOauthCallbackRoute
41
46
}
42
47
export interface FileRoutesById {
43
48
__root__: typeof rootRouteImport
44
49
'/': typeof IndexRoute
45
45
-
'/reserved/login': typeof ReservedLoginRoute
46
46
-
'/reserved/oauth/callback': typeof ReservedOauthCallbackRoute
50
50
+
'/_authed': typeof AuthedRouteWithChildren
51
51
+
'/login': typeof LoginRoute
52
52
+
'/_authed/oauth/callback': typeof AuthedOauthCallbackRoute
47
53
}
48
54
export interface FileRouteTypes {
49
55
fileRoutesByFullPath: FileRoutesByFullPath
50
50
-
fullPaths: '/' | '/reserved/login' | '/reserved/oauth/callback'
56
56
+
fullPaths: '/' | '/login' | '/oauth/callback'
51
57
fileRoutesByTo: FileRoutesByTo
52
52
-
to: '/' | '/reserved/login' | '/reserved/oauth/callback'
53
53
-
id: '__root__' | '/' | '/reserved/login' | '/reserved/oauth/callback'
58
58
+
to: '/' | '/login' | '/oauth/callback'
59
59
+
id: '__root__' | '/' | '/_authed' | '/login' | '/_authed/oauth/callback'
54
60
fileRoutesById: FileRoutesById
55
61
}
56
62
export interface RootRouteChildren {
57
63
IndexRoute: typeof IndexRoute
58
58
-
ReservedLoginRoute: typeof ReservedLoginRoute
59
59
-
ReservedOauthCallbackRoute: typeof ReservedOauthCallbackRoute
64
64
+
AuthedRoute: typeof AuthedRouteWithChildren
65
65
+
LoginRoute: typeof LoginRoute
60
66
}
61
67
62
68
declare module '@tanstack/react-router' {
63
69
interface FileRoutesByPath {
70
70
+
'/login': {
71
71
+
id: '/login'
72
72
+
path: '/login'
73
73
+
fullPath: '/login'
74
74
+
preLoaderRoute: typeof LoginRouteImport
75
75
+
parentRoute: typeof rootRouteImport
76
76
+
}
77
77
+
'/_authed': {
78
78
+
id: '/_authed'
79
79
+
path: ''
80
80
+
fullPath: ''
81
81
+
preLoaderRoute: typeof AuthedRouteImport
82
82
+
parentRoute: typeof rootRouteImport
83
83
+
}
64
84
'/': {
65
85
id: '/'
66
86
path: '/'
···
68
88
preLoaderRoute: typeof IndexRouteImport
69
89
parentRoute: typeof rootRouteImport
70
90
}
71
71
-
'/reserved/login': {
72
72
-
id: '/reserved/login'
73
73
-
path: '/reserved/login'
74
74
-
fullPath: '/reserved/login'
75
75
-
preLoaderRoute: typeof ReservedLoginRouteImport
76
76
-
parentRoute: typeof rootRouteImport
77
77
-
}
78
78
-
'/reserved/oauth/callback': {
79
79
-
id: '/reserved/oauth/callback'
80
80
-
path: '/reserved/oauth/callback'
81
81
-
fullPath: '/reserved/oauth/callback'
82
82
-
preLoaderRoute: typeof ReservedOauthCallbackRouteImport
83
83
-
parentRoute: typeof rootRouteImport
91
91
+
'/_authed/oauth/callback': {
92
92
+
id: '/_authed/oauth/callback'
93
93
+
path: '/oauth/callback'
94
94
+
fullPath: '/oauth/callback'
95
95
+
preLoaderRoute: typeof AuthedOauthCallbackRouteImport
96
96
+
parentRoute: typeof AuthedRoute
84
97
}
85
98
}
86
99
}
87
100
101
101
+
interface AuthedRouteChildren {
102
102
+
AuthedOauthCallbackRoute: typeof AuthedOauthCallbackRoute
103
103
+
}
104
104
+
105
105
+
const AuthedRouteChildren: AuthedRouteChildren = {
106
106
+
AuthedOauthCallbackRoute: AuthedOauthCallbackRoute,
107
107
+
}
108
108
+
109
109
+
const AuthedRouteWithChildren =
110
110
+
AuthedRoute._addFileChildren(AuthedRouteChildren)
111
111
+
88
112
const rootRouteChildren: RootRouteChildren = {
89
113
IndexRoute: IndexRoute,
90
90
-
ReservedLoginRoute: ReservedLoginRoute,
91
91
-
ReservedOauthCallbackRoute: ReservedOauthCallbackRoute,
114
114
+
AuthedRoute: AuthedRouteWithChildren,
115
115
+
LoginRoute: LoginRoute,
92
116
}
93
117
export const routeTree = rootRouteImport
94
118
._addFileChildren(rootRouteChildren)
+14
src/routes/_authed.tsx
···
1
1
+
import { createFileRoute, Outlet } from '@tanstack/react-router'
2
2
+
3
3
+
export const Route = createFileRoute('/_authed')({
4
4
+
component: RouteComponent,
5
5
+
})
6
6
+
7
7
+
function RouteComponent() {
8
8
+
return (
9
9
+
<div>
10
10
+
<p>Hello "/_authed"!</p>
11
11
+
<Outlet />
12
12
+
</div>
13
13
+
)
14
14
+
}
+1
-1
src/routes/index.tsx
···
9
9
The better frontend for the better forge.
10
10
</h1>
11
11
<Link
12
12
-
to="/reserved/login"
12
12
+
to="/login"
13
13
className="transition-all hover:bg-overlay0 bg-surface0 text-text p-2 rounded-xs"
14
14
>
15
15
Sign in
+1
-1
src/routes/reserved/login.tsx
src/routes/login.tsx
···
1
1
import { SignIn } from '@/components/Auth/SignIn'
2
2
import { createFileRoute } from '@tanstack/react-router'
3
3
4
4
-
export const Route = createFileRoute('/reserved/login')({
4
4
+
export const Route = createFileRoute('/login')({
5
5
component: RouteComponent,
6
6
})
7
7
+1
-1
src/routes/reserved/oauth/callback.tsx
src/routes/_authed/oauth/callback.tsx
···
1
1
import { createFileRoute } from '@tanstack/react-router'
2
2
3
3
-
export const Route = createFileRoute('/reserved/oauth/callback')({
3
3
+
export const Route = createFileRoute('/_authed/oauth/callback')({
4
4
component: RouteComponent,
5
5
})
6
6