Skip to content

Incorrect Callback/404 #5

@Pukimaa

Description

@Pukimaa

Hey. Whenever I try to log in this flow happens:
Login -> Discord Oauth Flow -> Success Page -> Redirect to Tauri -> Callback to localhost:1420/404

Meaning everything stays in the same page and no refresh is forced, thus my application not recognizing the logged in state. However once I force a reload or restart my application, everything works as expected. It's just the last callback.
I followed the Svelte Setup Guide from the README.md 1:1 while replacing the schema etc.

Logs

Browser Logs:

[Log] [Better Auth Tauri] handleAuthDeepLink fetch – "/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds" (@daveyplate_better-auth-tauri.js, line 2760)
[Log] Auth request: – "/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds" (+layout.svelte, line 33)
[Error] Failed to load resource: the server responded with a status of 404 (Not Found) (localhost, line 0)
[Log] [Better Auth Tauri] handleAuthDeepLink response (2) (@daveyplate_better-auth-tauri.js, line 2765)
{data: null, error: {status: 404, statusText: "Not Found"}}
"/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds"
[Error] [Better Auth Tauri] handleAuthDeepLink error (2)
{status: 404, statusText: "Not Found"}
"/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds"
	handleAuthDeepLink (@daveyplate_better-auth-tauri.js:2773)
[Error] Auth error: – {status: 404, statusText: "Not Found"}
	onError (+layout.svelte:42)
	handleAuthDeepLink (@daveyplate_better-auth-tauri.js:2779)

API Logs:

Started development server: http://localhost:3000
  api:dev | [Better Auth Tauri] Request URL: http://localhost:3000/auth/sign-in/social User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/60.5 Safari/605.1.15 Host: localhost:3000 Pathname: /api/auth/sign-in/social
  api:dev | [Better Auth Tauri] Appending callback URL to social provider discord http://localhost:3000/auth/callback/discord?callbackURL=elysium://
  api:dev | [Better Auth Tauri] Callback URL: null /api/auth/sign-in/social
  api:dev | [Better Auth Tauri] Request URL: http://localhost:3000/auth/callback/discord?callbackURL=elysium%3A%2F%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:145.0) Gecko/20100101 Firefox/145.0 Host: localhost:3000 Pathname: /api/auth/callback/discord
  api:dev | [Better Auth Tauri] Callback URL: elysium:// /api/auth/callback/discord
  api:dev | [Better Auth Tauri] Redirecting to: elysium://api/auth/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds /api/auth/callback/discord
  api:dev | [Better Auth Tauri] Request URL: http://localhost:3000/auth/callback/discord?callbackURL=%2F&code=LNhnvcQ0cVqJ9NKhmGQdeS4nk1lu1z&state=wplr2W88dpjoNiKVlFgx2xXXAeg143ds User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/60.5 Safari/605.1.15 Host: localhost:3000 Pathname: /api/auth/callback/discord
  api:dev | [Better Auth Tauri] Callback URL: / /api/auth/callback/discord

Video Walkthrough

2025-12-16.14-47-59.mp4

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions