-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swa emulator Error: Not Found #101
Comments
I was able to resolve the issue by adding |
Thanks for the report! |
Can you expand on this @geoffrich? I tried |
Ah apologies, I misunderstood your setup - you shouldn't need data-sveltekit-reload. The root issue is that you're browsing the site on SvelteKit's dev server (localhost:5173), but the SWA emulator is running on localhost:4280. This is why you need to add localhost:4280 to the auth links that use SWA for authentication -- localhost:5173/.auth/me returns 404 since SvelteKit doesn't know about that route. I guess that works, but it's a bit awkward. You could also browse the entire site on localhost:4280, but that won't update when you make changes in development -- you'll have to run You may want to consider making localhost:4280 an environment variable when running locally, so that it won't show up on your production site. Something like this:
<script>
import { env } from "$env/dynamic/public";
</script>
<h1>Hello world!</h1>
<a href="{env.PUBLIC_AUTH_BASE || ''}/.auth/login">Login</a> That being said, I haven't done anything with SWA auth + SvelteKit myself, so I've opened #102 to better understand what this adapter can support and what it can't. |
I am having trouble with the Authorization and authentication emulation. My swa-cli.config.json looks like the below.
Everything looks good when I execute
swa start
, but I receive aNot found: /.auth/me
when I try to go to any authentication endpoint. Is there some other configuration I am missing?The text was updated successfully, but these errors were encountered: