xephyr
05/04/2022, 3:35 PM@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`:Needle
05/04/2022, 3:35 PMxephyr
05/04/2022, 3:40 PM@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 😬silentworks
05/04/2022, 5:37 PM@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.Needle
05/04/2022, 5:37 PMsilentworks
05/04/2022, 5:42 PMBuffer
in the codebase. This is meant to work with nextjs, I'm not sure what nextjs edge runtime is.xephyr
05/04/2022, 5:50 PMBuffer
is in jwtDecoder
from the shared package (source: https://github.com/supabase-community/supabase-auth-helpers/blob/next/packages/shared/utils/jwt.ts#L2) which is called by withMiddlewareAuthRequired
(source: https://github.com/supabase-community/supabase-auth-helpers/blob/next/packages/nextjs/src/utils/withMiddlewareAuthRequired.ts#L60)xephyr
05/04/2022, 5:51 PMnode
) in which middleware runs in NextJS, which only has access to the following Web APIs: https://nextjs.org/docs/api-reference/edge-runtimesilentworks
05/04/2022, 6:00 PMxephyr
05/04/2022, 6:03 PMxephyr
05/04/2022, 6:03 PMjose
(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 🙂xephyr
05/04/2022, 11:22 PMsilentworks
05/04/2022, 11:29 PM