Is `@supabase/supabase-auth-helpers` in a transiti...
# help
x
Is
@supabase/supabase-auth-helpers
in a transitionary state (read: "Please do not use it" state) from an old implementation to new at the moment? Looks like we can't use
withMiddlewareAuthRequired
at all because it depends on APIs that don't exist in the NextJS Edge Runtime (https://nextjs.org/docs/api-reference/edge-runtime), e.g. `Buffer`:
n
Hello @xephyr! This thread has been automatically created from your message in #843999948717555735 a few seconds ago. We have already mentioned the @User so that they can see your message and help you as soon as possible! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ``...`` menu) and select "Leave Thread" to unsubscribe from future updates. Want to change the title? Use the ``/title`` command! We have solved your problem? Click the button below to archive it.
x
Side point: There's also a lot of references to
@supabase/auth-helpers-nextjs
in both the docs and the code itself (package.json
name
for example) which doesn't appear to be a thing. Looks like it used to be but the structure of the repo changed. I'd be happy to go through and update all of these so newcomers like myself aren't confused but honestly it feels like that should have been done as part of the MR that changed the structure, feels like a lot of the things provided by this package just don't work at the moment 😬
s
@supabase/auth-helpers-nextjs
is. the new structure, we just haven't gotten a release out as yet. We are aiming to get something out this week but we had some other blocking issues we are trying to resolve first.
n
xephyr (2022-05-04)
s
I can't see any direct reference to
Buffer
in the codebase. This is meant to work with nextjs, I'm not sure what nextjs edge runtime is.
Edge Runtime is the environment (not
node
) in which middleware runs in NextJS, which only has access to the following Web APIs: https://nextjs.org/docs/api-reference/edge-runtime
s
Open an issue on the repo with this info please.
x
Aye will do. 👍
I'm not super clear on the restrictions in Edge Runtime, but there's potential to use
jose
(which Next uses internally: https://github.com/vercel/examples/blob/main/edge-functions/jwt-authentication/lib/auth.ts#L25) to decode the jwt instead of that shared function which might work out better but I've no experience with it so hard to say for sure. All a dive in to the unknown for me atm 🙂
s
Ok thanks