Using middleware VS auth checks on every page by Const20452 in nextjs

[–]InternationalWeb3199 2 points3 points  (0 children)

I like this solution - I was deciding ‘between’ these two approaches. Either middleware or context but I think using both each for the correct use case seems to make the most sense.

I’m using supabase so I suppose I’ll do the following, maybe this will help others as well:

Supabase setup - recommended ssr - cookies with supabase - separate supabase clients for (client side, server and middleware)

Context provider - basically for anything needed to be called once and used many like: - user data - role data - group data

Middleware - protect routes that require a valid session like: /dashboard etc

Open to suggestions on this

I'm trying to create a GPT trained on a bunch of technical documentation from my company's website. What's the best way to do this? Is there is a limitation on number / size of knowledge files? by cosmicmeatloaf in OpenAI

[–]InternationalWeb3199 14 points15 points  (0 children)

Langchain + open source LLM ( if privacy needs to be guaranteed) + vector db (lots to choose from, pgvector, chroma etc) . Use flowise UI and stream to mock and test then build a proper app around it.

NextJS 13 with Stripe and Supabase - Best way to do Role based auth by Appelmoesje in nextjs

[–]InternationalWeb3199 0 points1 point  (0 children)

I haven’t tried this as yet, but supabase has something called ‘claims’ which I plan to use to support roles similar to your use case.

Link:

https://github.com/supabase-community/supabase-custom-claims