We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent cff17be commit a3e433bCopy full SHA for a3e433b
1 file changed
src/app/routes/auth/google.callback.tsx
@@ -1,10 +1,13 @@
1
-import { createFileRoute } from '@tanstack/react-router'
+import { createFileRoute, redirect } from '@tanstack/react-router'
2
3
import { GoogleAuthLoader } from '@/features/session/google'
4
5
import { SessionContracts } from '@/entities/session'
6
7
export const Route = createFileRoute('/auth/google/callback')({
8
component: GoogleAuthLoader,
9
- validateSearch: SessionContracts.GoogleCallbackSearchSchema
+ validateSearch: SessionContracts.GoogleCallbackSearchSchema,
10
+ beforeLoad({ search: { code, state } }) {
11
+ if (!code || !state) throw redirect({ to: '/' })
12
+ }
13
})
0 commit comments