-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
redirectToLogin() fails on localhost
Problem
When using the SDK and calling redirectToLogin(), if the app is running on localhost, the redirect fails.
Root cause: When appBaseUrl is not configured, redirectToLogin() creates a relative URL (/login?from_url=...) which resolves to http://localhost:3000/login - a page that doesn't exist on the local dev server.
Current behavior
// In auth.ts
const loginUrl = `${options.appBaseUrl ?? ""}/login?from_url=...`;| Environment | appBaseUrl | Result |
|---|---|---|
| Localhost | not set | /login → localhost:3000/login ❌ |
| Production | not set | /login → works if app has /login route |
| Production | set | {appBaseUrl}/login ✅ |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog