Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: add redirection page for login from legacy services #572

Merged
merged 2 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions src/routeTree.gen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { createFileRoute } from '@tanstack/react-router'
// Import Routes

import { Route as rootRoute } from './routes/__root'
import { Route as SigninImport } from './routes/signin'
import { Route as AuthImport } from './routes/auth'
import { Route as AnalyticsImport } from './routes/analytics'
import { Route as AccountImport } from './routes/account'
Expand All @@ -22,6 +23,7 @@ import { Route as AnalyticsIndexImport } from './routes/analytics/index'
import { Route as AccountIndexImport } from './routes/account/index'
import { Route as EmailChangeImport } from './routes/email.change'
import { Route as AuthSuccessImport } from './routes/auth/success'
import { Route as AuthSigninImport } from './routes/auth/signin'
import { Route as AuthResetPasswordImport } from './routes/auth/reset-password'
import { Route as AuthRegisterImport } from './routes/auth/register'
import { Route as AuthLoginImport } from './routes/auth/login'
Expand Down Expand Up @@ -55,6 +57,12 @@ const AnalyticsItemsItemIdLazyImport = createFileRoute(

// Create/Update Routes

const SigninRoute = SigninImport.update({
id: '/signin',
path: '/signin',
getParentRoute: () => rootRoute,
} as any)

const AuthRoute = AuthImport.update({
id: '/auth',
path: '/auth',
Expand Down Expand Up @@ -116,6 +124,12 @@ const AuthSuccessRoute = AuthSuccessImport.update({
getParentRoute: () => AuthRoute,
} as any)

const AuthSigninRoute = AuthSigninImport.update({
id: '/signin',
path: '/signin',
getParentRoute: () => AuthRoute,
} as any)

const AuthResetPasswordRoute = AuthResetPasswordImport.update({
id: '/reset-password',
path: '/reset-password',
Expand Down Expand Up @@ -297,6 +311,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthImport
parentRoute: typeof rootRoute
}
'/signin': {
id: '/signin'
path: '/signin'
fullPath: '/signin'
preLoaderRoute: typeof SigninImport
parentRoute: typeof rootRoute
}
'/_landing/about-us': {
id: '/_landing/about-us'
path: '/about-us'
Expand Down Expand Up @@ -395,6 +416,13 @@ declare module '@tanstack/react-router' {
preLoaderRoute: typeof AuthResetPasswordImport
parentRoute: typeof AuthImport
}
'/auth/signin': {
id: '/auth/signin'
path: '/signin'
fullPath: '/auth/signin'
preLoaderRoute: typeof AuthSigninImport
parentRoute: typeof AuthImport
}
'/auth/success': {
id: '/auth/success'
path: '/success'
Expand Down Expand Up @@ -595,6 +623,7 @@ interface AuthRouteChildren {
AuthLoginRoute: typeof AuthLoginRoute
AuthRegisterRoute: typeof AuthRegisterRoute
AuthResetPasswordRoute: typeof AuthResetPasswordRoute
AuthSigninRoute: typeof AuthSigninRoute
AuthSuccessRoute: typeof AuthSuccessRoute
}

Expand All @@ -603,6 +632,7 @@ const AuthRouteChildren: AuthRouteChildren = {
AuthLoginRoute: AuthLoginRoute,
AuthRegisterRoute: AuthRegisterRoute,
AuthResetPasswordRoute: AuthResetPasswordRoute,
AuthSigninRoute: AuthSigninRoute,
AuthSuccessRoute: AuthSuccessRoute,
}

Expand All @@ -626,6 +656,7 @@ export interface FileRoutesByFullPath {
'/account': typeof AccountRouteWithChildren
'/analytics': typeof AnalyticsRouteWithChildren
'/auth': typeof AuthRouteWithChildren
'/signin': typeof SigninRoute
'/about-us': typeof LandingAboutUsRoute
'/contact-us': typeof LandingContactUsRoute
'/disclaimer': typeof LandingDisclaimerRoute
Expand All @@ -640,6 +671,7 @@ export interface FileRoutesByFullPath {
'/auth/login': typeof AuthLoginRoute
'/auth/register': typeof AuthRegisterRoute
'/auth/reset-password': typeof AuthResetPasswordRoute
'/auth/signin': typeof AuthSigninRoute
'/auth/success': typeof AuthSuccessRoute
'/email/change': typeof EmailChangeRoute
'/account/': typeof AccountIndexRoute
Expand All @@ -660,6 +692,7 @@ export interface FileRoutesByFullPath {

export interface FileRoutesByTo {
'/auth': typeof AuthRouteWithChildren
'/signin': typeof SigninRoute
'/about-us': typeof LandingAboutUsRoute
'/contact-us': typeof LandingContactUsRoute
'/disclaimer': typeof LandingDisclaimerRoute
Expand All @@ -674,6 +707,7 @@ export interface FileRoutesByTo {
'/auth/login': typeof AuthLoginRoute
'/auth/register': typeof AuthRegisterRoute
'/auth/reset-password': typeof AuthResetPasswordRoute
'/auth/signin': typeof AuthSigninRoute
'/auth/success': typeof AuthSuccessRoute
'/email/change': typeof EmailChangeRoute
'/account': typeof AccountIndexRoute
Expand All @@ -696,6 +730,7 @@ export interface FileRoutesById {
'/account': typeof AccountRouteWithChildren
'/analytics': typeof AnalyticsRouteWithChildren
'/auth': typeof AuthRouteWithChildren
'/signin': typeof SigninRoute
'/_landing/about-us': typeof LandingAboutUsRoute
'/_landing/contact-us': typeof LandingContactUsRoute
'/_landing/disclaimer': typeof LandingDisclaimerRoute
Expand All @@ -710,6 +745,7 @@ export interface FileRoutesById {
'/auth/login': typeof AuthLoginRoute
'/auth/register': typeof AuthRegisterRoute
'/auth/reset-password': typeof AuthResetPasswordRoute
'/auth/signin': typeof AuthSigninRoute
'/auth/success': typeof AuthSuccessRoute
'/email/change': typeof EmailChangeRoute
'/account/': typeof AccountIndexRoute
Expand All @@ -735,6 +771,7 @@ export interface FileRouteTypes {
| '/account'
| '/analytics'
| '/auth'
| '/signin'
| '/about-us'
| '/contact-us'
| '/disclaimer'
Expand All @@ -749,6 +786,7 @@ export interface FileRouteTypes {
| '/auth/login'
| '/auth/register'
| '/auth/reset-password'
| '/auth/signin'
| '/auth/success'
| '/email/change'
| '/account/'
Expand All @@ -768,6 +806,7 @@ export interface FileRouteTypes {
fileRoutesByTo: FileRoutesByTo
to:
| '/auth'
| '/signin'
| '/about-us'
| '/contact-us'
| '/disclaimer'
Expand All @@ -782,6 +821,7 @@ export interface FileRouteTypes {
| '/auth/login'
| '/auth/register'
| '/auth/reset-password'
| '/auth/signin'
| '/auth/success'
| '/email/change'
| '/account'
Expand All @@ -802,6 +842,7 @@ export interface FileRouteTypes {
| '/account'
| '/analytics'
| '/auth'
| '/signin'
| '/_landing/about-us'
| '/_landing/contact-us'
| '/_landing/disclaimer'
Expand All @@ -816,6 +857,7 @@ export interface FileRouteTypes {
| '/auth/login'
| '/auth/register'
| '/auth/reset-password'
| '/auth/signin'
| '/auth/success'
| '/email/change'
| '/account/'
Expand All @@ -840,6 +882,7 @@ export interface RootRouteChildren {
AccountRoute: typeof AccountRouteWithChildren
AnalyticsRoute: typeof AnalyticsRouteWithChildren
AuthRoute: typeof AuthRouteWithChildren
SigninRoute: typeof SigninRoute
EmailChangeRoute: typeof EmailChangeRoute
PlayerIndexRoute: typeof PlayerIndexRoute
PlayerRootIdItemIdRoute: typeof PlayerRootIdItemIdRouteWithChildren
Expand All @@ -851,6 +894,7 @@ const rootRouteChildren: RootRouteChildren = {
AccountRoute: AccountRouteWithChildren,
AnalyticsRoute: AnalyticsRouteWithChildren,
AuthRoute: AuthRouteWithChildren,
SigninRoute: SigninRoute,
EmailChangeRoute: EmailChangeRoute,
PlayerIndexRoute: PlayerIndexRoute,
PlayerRootIdItemIdRoute: PlayerRootIdItemIdRouteWithChildren,
Expand All @@ -871,6 +915,7 @@ export const routeTree = rootRoute
"/account",
"/analytics",
"/auth",
"/signin",
"/email/change",
"/player/",
"/player/$rootId/$itemId",
Expand Down Expand Up @@ -913,9 +958,13 @@ export const routeTree = rootRoute
"/auth/login",
"/auth/register",
"/auth/reset-password",
"/auth/signin",
"/auth/success"
]
},
"/signin": {
"filePath": "signin.tsx"
},
"/_landing/about-us": {
"filePath": "_landing/about-us.tsx",
"parent": "/_landing"
Expand Down Expand Up @@ -972,6 +1021,10 @@ export const routeTree = rootRoute
"filePath": "auth/reset-password.tsx",
"parent": "/auth"
},
"/auth/signin": {
"filePath": "auth/signin.tsx",
"parent": "/auth"
},
"/auth/success": {
"filePath": "auth/success.tsx",
"parent": "/auth"
Expand Down
10 changes: 10 additions & 0 deletions src/routes/auth/signin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createFileRoute, redirect } from '@tanstack/react-router';

// legacy redirection for routes using the old `signin` route.
// this should be removed 6 months after the push of the new client interface in production.
// estimated date at time of writing is July 2025
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
export const Route = createFileRoute('/auth/signin')({
beforeLoad: (ctx) => {
throw redirect({ to: '/auth/login', search: ctx.search });
},
});
10 changes: 10 additions & 0 deletions src/routes/signin.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { createFileRoute, redirect } from '@tanstack/react-router';

// legacy redirection for routes using the old `signin` route.
// this should be removed 6 months after the push of the new client interface in production.
// estimated date at time of writing is July 2025
spaenleh marked this conversation as resolved.
Show resolved Hide resolved
export const Route = createFileRoute('/signin')({
beforeLoad: (ctx) => {
throw redirect({ to: '/auth/login', search: ctx.search });
},
});
Loading