Skip to content

Commit a41e7cf

Browse files
EthanShoeDevSeanCassiere
andauthoredApr 6, 2025··
chore(examples): do not use GET to send credentials (#3945)
Fixes #3944 --- Co-authored-by: Sean Cassiere <33615041+SeanCassiere@users.noreply.github.com>
1 parent 30c49e1 commit a41e7cf

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed
 

Diff for: ‎examples/react/start-basic-auth/src/routes/_authed.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { hashPassword, prismaClient } from '~/utils/prisma'
44
import { Login } from '~/components/Login'
55
import { useAppSession } from '~/utils/session'
66

7-
export const loginFn = createServerFn()
7+
export const loginFn = createServerFn({ method: 'POST' })
88
.validator((d) => d as { email: string; password: string })
99
.handler(async ({ data }) => {
1010
// Find the user

Diff for: ‎examples/react/start-basic-auth/src/routes/signup.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useMutation } from '~/hooks/useMutation'
55
import { Auth } from '~/components/Auth'
66
import { useAppSession } from '~/utils/session'
77

8-
export const signupFn = createServerFn()
8+
export const signupFn = createServerFn({ method: 'POST' })
99
.validator(
1010
(d) =>
1111
d as {

Diff for: ‎examples/react/start-supabase-basic/src/routes/_authed.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { createServerFn } from '@tanstack/react-start'
33
import { Login } from '../components/Login'
44
import { getSupabaseServerClient } from '../utils/supabase'
55

6-
export const loginFn = createServerFn()
6+
export const loginFn = createServerFn({ method: 'POST' })
77
.validator((d) => d as { email: string; password: string })
88
.handler(async ({ data }) => {
99
const supabase = await getSupabaseServerClient()

Diff for: ‎examples/react/start-supabase-basic/src/routes/signup.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useMutation } from '../hooks/useMutation'
44
import { Auth } from '../components/Auth'
55
import { getSupabaseServerClient } from '../utils/supabase'
66

7-
export const signupFn = createServerFn()
7+
export const signupFn = createServerFn({ method: 'POST' })
88
.validator(
99
(d: unknown) =>
1010
d as { email: string; password: string; redirectUrl?: string },

0 commit comments

Comments
 (0)
Please sign in to comment.