Skip to content

Commit 793dbad

Browse files
committed
fix: use client signIn helper on home and bump @zitadel/tanstack-auth to 1.1.2
The home Login button hardcoded a GET to /api/auth/signin/zitadel, which Auth.js v5 rejects with a Configuration error. Use the SDK client signIn helper (CSRF+POST) and bump the SDK to the version that ships the fix.
1 parent 1772dbf commit 793dbad

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

app/routes/index.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { createFileRoute } from '@tanstack/react-router';
2+
import { signIn } from '@zitadel/tanstack-auth/client';
23
import { Header } from '~/components/Header';
34
import { Footer } from '~/components/Footer';
45

@@ -112,8 +113,11 @@ function IndexPage() {
112113
/>
113114
</div>
114115
</div>
115-
<a
116-
href="/api/auth/signin/zitadel"
116+
<button
117+
type="button"
118+
onClick={() =>
119+
void signIn('zitadel', { callbackUrl: '/profile' })
120+
}
117121
className="mb-6 flex w-full cursor-pointer items-center justify-center space-x-2 rounded-lg bg-blue-600 px-4 py-3 font-semibold text-white transition duration-200 hover:bg-blue-700"
118122
>
119123
<svg
@@ -132,7 +136,7 @@ function IndexPage() {
132136
/>
133137
</svg>
134138
<span>Login</span>
135-
</a>
139+
</button>
136140
<div className="text-center">
137141
<p className="mb-4 text-sm text-gray-500">
138142
What happens when you click the button:

package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
"@tanstack/react-router": "^1.168.0",
2525
"@tanstack/react-start": "^1.168.0",
2626
"@tanstack/start-storage-context": "^1.167.0",
27-
"@zitadel/tanstack-auth": "^1.0.0",
27+
"@zitadel/tanstack-auth": "^1.1.2",
2828
"openid-client": "^6.6.3",
2929
"react": "^19",
3030
"react-dom": "^19"

0 commit comments

Comments
 (0)