Skip to content

Commit a3e433b

Browse files
committed
fix: minor updates & improvements
1 parent cff17be commit a3e433b

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
import { createFileRoute } from '@tanstack/react-router'
1+
import { createFileRoute, redirect } from '@tanstack/react-router'
22

33
import { GoogleAuthLoader } from '@/features/session/google'
44

55
import { SessionContracts } from '@/entities/session'
66

77
export const Route = createFileRoute('/auth/google/callback')({
88
component: GoogleAuthLoader,
9-
validateSearch: SessionContracts.GoogleCallbackSearchSchema
9+
validateSearch: SessionContracts.GoogleCallbackSearchSchema,
10+
beforeLoad({ search: { code, state } }) {
11+
if (!code || !state) throw redirect({ to: '/' })
12+
}
1013
})

0 commit comments

Comments
 (0)