Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
7 changes: 7 additions & 0 deletions e2e/solid-start/basic-auth/.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Environment variables declared in this file are automatically made available to Prisma.
# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema

# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB.
# See the documentation for all the connection string options: https://pris.ly/d/connection-strings

DATABASE_URL="file:./dev.db"
20 changes: 20 additions & 0 deletions e2e/solid-start/basic-auth/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
node_modules
package-lock.json
yarn.lock

!.env
.DS_Store
.cache
.vercel
.output

Comment on lines +5 to +10
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Do not un-ignore .env — risk of committing secrets.

Replace the negate rule with ignores and keep only an example file tracked.

-!.env
+.env
+.env.*
+!.env.example
 .DS_Store
 .cache
 .vercel
 .output

Optional: also ignore common debug logs

  • pnpm-debug.log*
  • npm-debug.log*
  • yarn-error.log*
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
!.env
.DS_Store
.cache
.vercel
.output
.env
.env.*
!.env.example
.DS_Store
.cache
.vercel
.output
🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/.gitignore around lines 5 to 10, the .gitignore
currently un-ignores .env (using "! .env") which risks committing secrets;
replace the negate rule by re-adding ".env" to the ignore list, create and track
a safe ".env.example" with placeholder values instead, and optionally append
common debug log ignores such as "pnpm-debug.log*", "npm-debug.log*", and
"yarn-error.log*" to the .gitignore.

/build/
/api/
/server/build
/public/build
# Sentry Config File
.env.sentry-build-plugin
/test-results/
/playwright-report/
/blob-report/
/playwright/.cache/
4 changes: 4 additions & 0 deletions e2e/solid-start/basic-auth/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
**/build
**/public
pnpm-lock.yaml
routeTree.gen.ts
36 changes: 36 additions & 0 deletions e2e/solid-start/basic-auth/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"name": "tanstack-solid-start-e2e-basic-auth",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"dev": "vite dev --port 3000",
"dev:e2e": "vite dev",
"build": "vite build",
"start": "node .output/server/index.mjs",
"prisma-generate": "prisma generate",
"test:e2e": "exit 0; rm -rf port*.txt; pnpm run prisma-generate && playwright test --project=chromium"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Tests never run: exit 0 short‑circuits the e2e script.

Remove it so Playwright actually executes.

-    "test:e2e": "exit 0; rm -rf port*.txt; pnpm run prisma-generate && playwright test --project=chromium"
+    "test:e2e": "rm -rf port*.txt && pnpm run prisma-generate && playwright test --project=chromium"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
"test:e2e": "exit 0; rm -rf port*.txt; pnpm run prisma-generate && playwright test --project=chromium"
"test:e2e": "rm -rf port*.txt && pnpm run prisma-generate && playwright test --project=chromium"
🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/package.json around line 12, the "test:e2e" script
currently prefixes the command with "exit 0" which short-circuits the script and
prevents Playwright from running; remove the "exit 0;" prefix so the script runs
the cleanup, prisma-generate, and then executes "playwright test
--project=chromium" in sequence (keeping the rm -rf and pnpm run prisma-generate
steps intact).

},
"dependencies": {
"@prisma/client": "5.22.0",
"@tanstack/solid-router": "workspace:^",
"@tanstack/solid-router-devtools": "workspace:^",
"@tanstack/solid-start": "workspace:^",
"prisma": "^5.22.0",
Comment on lines +16 to +19
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Use workspace:* for internal deps (per repo guidelines).

Align all internal TanStack packages to workspace:*.

As per coding guidelines.

   "dependencies": {
     "@prisma/client": "5.22.0",
-    "@tanstack/solid-router": "workspace:^",
-    "@tanstack/solid-router-devtools": "workspace:^",
-    "@tanstack/solid-start": "workspace:^",
+    "@tanstack/solid-router": "workspace:*",
+    "@tanstack/solid-router-devtools": "workspace:*",
+    "@tanstack/solid-start": "workspace:*",
@@
   "devDependencies": {
@@
-    "@tanstack/router-e2e-utils": "workspace:^",
+    "@tanstack/router-e2e-utils": "workspace:*",

Also applies to: 27-27


I'll verify the review comment by checking the current state of the file and examining patterns across the repository.


🏁 Script executed:

#!/bin/bash
# Check the actual content of the target package.json file
echo "=== Target file content (lines 16-27) ==="
sed -n '16,27p' e2e/solid-start/basic-auth/package.json

echo -e "\n=== All package.json files in e2e/ directory ==="
find e2e -name "package.json" -type f

echo -e "\n=== Checking workspace protocol usage in all e2e package.json files ==="
for file in $(find e2e -name "package.json" -type f); do
  echo "File: $file"
  grep -E '@tanstack/.*workspace:\^|@tanstack/.*workspace:\*' "$file" || echo "  No TanStack workspace deps found"
done

echo -e "\n=== Checking workspace protocol usage in root packages ==="
find . -maxdepth 2 -name "package.json" -type f | xargs grep -l '@tanstack' | head -5 | while read file; do
  echo "File: $file"
  grep -E '@tanstack/.*workspace:\^|@tanstack/.*workspace:\*' "$file" | head -3 || echo "  No matches"
done

Length of output: 18194


Change all internal TanStack dependencies from workspace:^ to workspace:* per repository guidelines.

This pattern violation is systematic across the entire e2e/ directory. All internal TanStack packages must use workspace:*. Update e2e/solid-start/basic-auth/package.json along with all other e2e package.json files to align with repository standards and the root package.json pattern.

   "dependencies": {
     "@prisma/client": "5.22.0",
-    "@tanstack/solid-router": "workspace:^",
-    "@tanstack/solid-router-devtools": "workspace:^",
-    "@tanstack/solid-start": "workspace:^",
+    "@tanstack/solid-router": "workspace:*",
+    "@tanstack/solid-router-devtools": "workspace:*",
+    "@tanstack/solid-start": "workspace:*",
   },
   "devDependencies": {
-    "@tanstack/router-e2e-utils": "workspace:^",
+    "@tanstack/router-e2e-utils": "workspace:*",

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/package.json around lines 16 to 19 the internal
TanStack dependencies use the incorrect version range "workspace:^"; update each
internal TanStack entry ("@tanstack/solid-router",
"@tanstack/solid-router-devtools", "@tanstack/solid-start") to use "workspace:*"
instead of "workspace:^". Also scan and update all other package.json files
under the e2e/ directory to replace any "workspace:^" references for internal
TanStack packages with "workspace:*" so they match the repository root pattern.

"solid-js": "^1.9.5",
"redaxios": "^0.5.1",
"tailwind-merge": "^2.6.0",
"vite": "^7.1.7"
},
"devDependencies": {
"@playwright/test": "^1.50.1",
"@tanstack/router-e2e-utils": "workspace:^",
"@types/node": "^22.10.2",
"vite-plugin-solid": "^2.11.9",
"autoprefixer": "^10.4.20",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.17",
"typescript": "^5.7.2",
"vite-tsconfig-paths": "^5.1.4"
}
}
34 changes: 34 additions & 0 deletions e2e/solid-start/basic-auth/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import { defineConfig, devices } from '@playwright/test'
import { getTestServerPort } from '@tanstack/router-e2e-utils'
import packageJson from './package.json' with { type: 'json' }

const PORT = await getTestServerPort(packageJson.name)
const baseURL = `http://localhost:${PORT}`
/**
* See https://playwright.dev/docs/test-configuration.
*/
export default defineConfig({
testDir: './tests',
workers: 1,

reporter: [['line']],

use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL,
},

webServer: {
command: `VITE_SERVER_PORT=${PORT} pnpm build && PORT=${PORT} VITE_SERVER_PORT=${PORT} pnpm start`,
url: baseURL,
reuseExistingServer: !process.env.CI,
stdout: 'pipe',
},

projects: [
{
name: 'chromium',
use: { ...devices['Desktop Chrome'] },
},
],
})
6 changes: 6 additions & 0 deletions e2e/solid-start/basic-auth/postcss.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file added e2e/solid-start/basic-auth/prisma/dev.db
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- CreateTable
CREATE TABLE "User" (
"email" TEXT NOT NULL PRIMARY KEY,
"password" TEXT NOT NULL
);

-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
Comment on lines +7 to +8
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Redundant unique index on primary key column.

The User_email_key unique index is redundant since email is already defined as the PRIMARY KEY (Line 3), which implicitly guarantees uniqueness and creates an index.

Apply this diff to remove the redundant index:

-
--- CreateIndex
-CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
-- CreateIndex
CREATE UNIQUE INDEX "User_email_key" ON "User"("email");
🤖 Prompt for AI Agents
In
e2e/solid-start/basic-auth/prisma/migrations/20240811183753_init/migration.sql
around lines 7-8, the CREATE UNIQUE INDEX "User_email_key" on "User"(email) is
redundant because email is already the PRIMARY KEY; remove that CREATE UNIQUE
INDEX statement from the migration file so the primary key's implicit index is
used instead.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Please do not edit this file manually
# It should be added in your version-control system (i.e. Git)
provider = "sqlite"
16 changes: 16 additions & 0 deletions e2e/solid-start/basic-auth/prisma/schema.prisma
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// This is your Prisma schema file,
// learn more about it in the docs: https://pris.ly/d/prisma-schema

generator client {
provider = "prisma-client-js"
}

datasource db {
provider = "sqlite"
url = env("DATABASE_URL")
}

model User {
email String @id @unique
password String
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added e2e/solid-start/basic-auth/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added e2e/solid-start/basic-auth/public/favicon.ico
Binary file not shown.
Binary file added e2e/solid-start/basic-auth/public/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions e2e/solid-start/basic-auth/public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-512x512.png",
"sizes": "512x512",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
59 changes: 59 additions & 0 deletions e2e/solid-start/basic-auth/src/components/Auth.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import type { JSX } from 'solid-js'

export function Auth({
actionText,
onSubmit,
status,
afterSubmit,
}: {
actionText: string
onSubmit: (e: HTMLFormElement) => void
status: 'pending' | 'idle' | 'success' | 'error'
afterSubmit?: JSX.Element
Comment on lines +10 to +12
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Fix onSubmit typing and pass the form element (strict mode).

Prop type promises an HTMLFormElement but you pass the event; remove any and forward the form.

   }: {
     actionText: string
-    onSubmit: (e: HTMLFormElement) => void
+    onSubmit: (form: HTMLFormElement) => void
     status: 'pending' | 'idle' | 'success' | 'error'
     afterSubmit?: JSX.Element
   }) {
@@
-        <form
-          onSubmit={(e: any) => {
+        <form
+          onSubmit={(e) => {
             e.preventDefault()
-            onSubmit(e)
+            onSubmit(e.currentTarget as HTMLFormElement)
           }}
           class="space-y-4"
         >

Also applies to: 19-22

🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/src/components/Auth.tsx around lines 10-12 (and
similarly lines 19-22), the onSubmit prop is typed as accepting an
HTMLFormElement but the component passes the submit event (and uses any) —
update the prop signature to accept the form element (e.g., onSubmit: (form:
HTMLFormElement) => void), remove any usages of any, and change the submit
handler to call props.onSubmit(e.currentTarget as HTMLFormElement) (or extract
the form element and forward it) so the actual HTMLFormElement is passed in
strict mode.

}) {
return (
<div class="fixed inset-0 bg-white dark:bg-black flex items-start justify-center p-8">
<div class="bg-white dark:bg-gray-900 p-8 rounded-lg shadow-lg">
<h1 class="text-2xl font-bold mb-4">{actionText}</h1>
<form
onSubmit={(e: any) => {
e.preventDefault()
onSubmit(e)
}}
class="space-y-4"
>
<div>
<label for="email" class="block text-xs">
Email
</label>
<input
type="email"
name="email"
id="email"
class="px-2 py-1 w-full rounded border border-gray-500/20 bg-white dark:bg-gray-800"
/>
</div>
<div>
<label for="password" class="block text-xs">
Password
</label>
<input
type="password"
name="password"
id="password"
class="px-2 py-1 w-full rounded border border-gray-500/20 bg-white dark:bg-gray-800"
/>
</div>
<button
type="submit"
class="w-full bg-cyan-600 text-white rounded py-2 font-black uppercase"
disabled={status === 'pending'}
>
{status === 'pending' ? '...' : actionText}
</button>
{afterSubmit ? afterSubmit : null}
</form>
</div>
</div>
)
}
53 changes: 53 additions & 0 deletions e2e/solid-start/basic-auth/src/components/DefaultCatchBoundary.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
import {
ErrorComponent,
Link,
rootRouteId,
useMatch,
useRouter,
} from '@tanstack/solid-router'
import type { ErrorComponentProps } from '@tanstack/solid-router'

export function DefaultCatchBoundary({ error }: ErrorComponentProps) {
const router = useRouter()
const isRoot = useMatch({
strict: false,
select: (state) => state.id === rootRouteId,
})

console.error(error)

return (
<div class="min-w-0 flex-1 p-4 flex flex-col items-center justify-center gap-6">
<ErrorComponent error={error} />
<div class="flex gap-2 items-center flex-wrap">
<button
onClick={() => {
router.invalidate()
}}
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Try Again
</button>
{isRoot() ? (
<Link
to="/"
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
>
Home
</Link>
) : (
<Link
to="/"
class={`px-2 py-1 bg-gray-600 dark:bg-gray-700 rounded text-white uppercase font-extrabold`}
onClick={(e) => {
e.preventDefault()
window.history.back()
}}
>
Go Back
</Link>
)}
</div>
</div>
)
}
71 changes: 71 additions & 0 deletions e2e/solid-start/basic-auth/src/components/Login.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { useRouter } from '@tanstack/solid-router'
import { useServerFn } from '@tanstack/solid-start'
import { useMutation } from '../hooks/useMutation'
import { loginFn } from '../routes/_authed'
import { Auth } from './Auth'
import { signupFn } from '~/routes/signup'

export function Login() {
const router = useRouter()

const loginMutation = useMutation({
fn: loginFn,
onSuccess: async (ctx) => {
if (!ctx.data?.error) {
await router.invalidate()
router.navigate({ to: '/' })
return
}
},
})
Comment on lines +11 to +20
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Call the server function via useServerFn(loginFn) (client-side).

Directly invoking loginFn on the client will fail; bind it like you did for signup.

   const loginMutation = useMutation({
-    fn: loginFn,
+    fn: useServerFn(loginFn),
     onSuccess: async (ctx) => {
       if (!ctx.data?.error) {
         await router.invalidate()
         router.navigate({ to: '/' })
         return
       }
     },
   })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const loginMutation = useMutation({
fn: loginFn,
onSuccess: async (ctx) => {
if (!ctx.data?.error) {
await router.invalidate()
router.navigate({ to: '/' })
return
}
},
})
const loginMutation = useMutation({
fn: useServerFn(loginFn),
onSuccess: async (ctx) => {
if (!ctx.data?.error) {
await router.invalidate()
router.navigate({ to: '/' })
return
}
},
})
🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/src/components/Login.tsx around lines 11 to 20,
the mutation is calling the server function directly (loginFn) which will fail
on the client; update the component to bind the server function on the client by
calling useServerFn(loginFn) and use that returned client-bound function inside
useMutation's fn, and ensure useServerFn is imported from the correct package
and used consistently (like the signup implementation) so the mutation invokes
the bound client wrapper rather than the raw server function.


const signupMutation = useMutation({
fn: useServerFn(signupFn),
})

return (
<Auth
actionText="Login"
status={loginMutation.status()}
onSubmit={(e) => {
const formData = new FormData(e.target as unknown as HTMLFormElement)

loginMutation.mutate({
data: {
email: formData.get('email') as string,
password: formData.get('password') as string,
},
})
Comment on lines +33 to +38
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix login payload: remove data: wrapper.

Matches inputValidator and handler expectations.

-        loginMutation.mutate({
-          data: {
-            email: formData.get('email') as string,
-            password: formData.get('password') as string,
-          },
-        })
+        loginMutation.mutate({
+          email: formData.get('email') as string,
+          password: formData.get('password') as string,
+        })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
loginMutation.mutate({
data: {
email: formData.get('email') as string,
password: formData.get('password') as string,
},
})
loginMutation.mutate({
email: formData.get('email') as string,
password: formData.get('password') as string,
})
🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/src/components/Login.tsx around lines 33 to 38,
the login mutation is sending the payload wrapped in a top-level `data` object
but the server-side inputValidator/handler expect the raw { email, password }
shape; remove the `data:` wrapper and pass { email: formData.get('email') as
string, password: formData.get('password') as string } directly to
loginMutation.mutate so the payload matches the expected input shape.

}}
Comment on lines +31 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion | 🟠 Major

Align onSubmit param with Auth (form element) and remove unsafe casts.

After fixing Auth, receive the form and build FormData from it.
Apply this diff:

-      onSubmit={(e) => {
-        const formData = new FormData(e.target as unknown as HTMLFormElement)
+      onSubmit={(form) => {
+        const formData = new FormData(form)
 
-        loginMutation.mutate({
-          data: {
-            email: formData.get('email') as string,
-            password: formData.get('password') as string,
-          },
-        })
+        loginMutation.mutate({
+          email: formData.get('email') as string,
+          password: formData.get('password') as string,
+        })
       }}

Committable suggestion skipped: line range outside the PR's diff.

🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/src/components/Login.tsx around lines 31 to 39,
the onSubmit handler currently uses an incorrectly typed event and performs
unsafe casts when creating FormData; update the handler signature to accept the
proper form event (so the parameter is typed as an HTMLFormElement or a
SubmitEvent whose currentTarget is an HTMLFormElement), obtain the form element
from e.currentTarget (or accept the form directly) and construct new
FormData(form) without any "as unknown" or "as string" casts, then pass the
email and password values to loginMutation.mutate ensuring correct null handling
(e.g., default to empty string or validate before submit).

afterSubmit={
loginMutation.data() ? (
<>
<div class="text-red-400">{loginMutation.data()?.message}</div>
{loginMutation.data()?.userNotFound ? (
<div>
<button
class="text-blue-500"
onClick={(e) => {
const formData = new FormData(
(e.target as HTMLButtonElement).form!,
)

signupMutation.mutate({
data: {
email: formData.get('email') as string,
password: formData.get('password') as string,
},
})
Comment on lines +53 to +58
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

Fix signup fallback payload: remove data: wrapper.

Keep the shape consistent with signupFn.

-                    signupMutation.mutate({
-                      data: {
-                        email: formData.get('email') as string,
-                        password: formData.get('password') as string,
-                      },
-                    })
+                    signupMutation.mutate({
+                      email: formData.get('email') as string,
+                      password: formData.get('password') as string,
+                    })
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
signupMutation.mutate({
data: {
email: formData.get('email') as string,
password: formData.get('password') as string,
},
})
signupMutation.mutate({
email: formData.get('email') as string,
password: formData.get('password') as string,
})
🤖 Prompt for AI Agents
In e2e/solid-start/basic-auth/src/components/Login.tsx around lines 53 to 58,
the signup mutation call wraps the credentials in a `data:` property which
mismatches the expected shape of `signupFn`; remove the `data:` wrapper and pass
the payload as an object with `email` and `password` directly (i.e., call
signupMutation.mutate({ email: formData.get('email') as string, password:
formData.get('password') as string })) so the payload shape matches signupFn.

}}
type="button"
>
Sign up instead?
</button>
</div>
) : null}
</>
) : null
}
/>
)
}
25 changes: 25 additions & 0 deletions e2e/solid-start/basic-auth/src/components/NotFound.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import { Link } from '@tanstack/solid-router'

export function NotFound({ children }: { children?: any }) {
return (
<div class="space-y-2 p-2">
<div class="text-gray-600 dark:text-gray-400">
{children || <p>The page you are looking for does not exist.</p>}
</div>
<p class="flex items-center gap-2 flex-wrap">
<button
onClick={() => window.history.back()}
class="bg-emerald-500 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Go back
</button>
<Link
to="/"
class="bg-cyan-600 text-white px-2 py-1 rounded uppercase font-black text-sm"
>
Start Over
</Link>
</p>
</div>
)
}
Loading
Loading