-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[🐞] callbackUrl does not work with Auth.js integration #5227
Comments
Can you try removing export const onGet: RequestHandler = async ({ cacheControl }) => {
// Control caching for this request for best performance and to reduce hosting costs:
// https://qwik.builder.io/docs/caching/
cacheControl({
// Always serve a cached response by default, up to a week stale
staleWhileRevalidate: 60 * 60 * 24 * 7,
// Max once every 5 seconds, revalidate on the server to get a fresh version of this page
maxAge: 5,
});
}; from your root layout? I spent a week trying to make auth work with this at the root layout but this doesn't work well with browser behavior and authentication. You may be able to set cacheControl lower down the layout tree for some static authed pages with |
Hm, yea I can definitely see how that might cause an issue for rendering user specific content. I tried removing it and it doesn't address the callbackUrl issue though. |
Hi Kevin! Have you made any progress on this? I am banging my head on this since three days with no progress. What works for me is, when I redirect to But now I am providing my own signin page, in which I want to use I would be overly happy, if you could help me out of this frustration. |
Unfortunately I didn't. When I encountered this it was for a proof of concept app built with Qwik and I've sinced moved on. Hopefully someone smarter than me can dig into it and figure out what is wrong. |
Guys, any progress on this? |
Thanks for the awesome library. Unfortunately I'm still facing this issue. I don't want to ditch my Qwik app for this. Any patch or temporary hack would be appreciated! Tagging @manucorporat @ulic75 as you guys have worked greatly on the library. |
I recall looking into this in the past, but obviously didn't find anything concrete or I would have submitted a PR. I've switch from auth.js to Lucia and likely won't have the time to dig into this again, but we'll see. |
Any progress on this? |
@PatrickJS or @wmertens could you reopen this issue as the fix from #6156 wasn't fully solving the problem? I've just opened a PR in |
Which component is affected?
Qwik Runtime
Describe the bug
When specifying either a relative or absolute url (where the protocol and origin match hosted site) the callback url does not work as expected and you are always redirected to the root of the site.
Reproduction
https://stackblitz.com/edit/qwik-starter-ug5wfp
Steps to reproduce
GITHUB_ID
andGITHUB_SECRET
with valid valuesnpm install
followed bynpm run dev
Expected:
Because I hardcoded a callbackUrl of
http://localhost:5173/demo/flower
you should end up on the flower demo after signing in.Actual:
You end up on the homepage.
Note: This plugin doesn't seem to like stackblitz so you'll have to do this locally
System Info
Additional Information
I didn't include this in the example but I noticed that the
redirect
callback seems to be invoked on every request. The documentation states that it should only be called anytime the user is redirected to a callback URL so this seems incorrect.In
src/routes/plugin@auth.ts
you can add this callbacks section to see how often the callback is invoked:The text was updated successfully, but these errors were encountered: