j4w8n / sveltekit-supabase-ssr Goto Github PK
View Code? Open in Web Editor NEWA demo Auth app
A demo Auth app
The logout-event is triggered on the frontend from +layout.svelte
via a post request. However, wouldn't it be simpler to just call
supabase.auth.signOut():
invalidate();
?
I wonder what the benefits of the other implementation are. Is it more secure or does it simply allow for additional business logic on the backend when a logout-event is triggered?
PS: Love the template! Learned a lot from it!
safeGetSession replaced by GetSession. this verifies JWT token so extra lines no longer needed.
Your thorough posts are helpful in understanding the ssr flow with supabase. I currently use your repository for setting up authentication. But I seem to repeatedly run into issues and have no clue how to resolve it. For that matter, I get the same issue with the supabase ssr setup (all in sveltekit).
After a while of not entering the website, I stumble upon a 502 Bad Gateway on entering the website again. After clearing my cookies, I can enter the website again. So it seems there is an issue with cookie setting/refreshing.
When I investigate the logs I get a clear status 200 response for refreshing the token. There are no errors or issues to be found in the logs (on the contrary), but I still cannot enter until I clear my cookies.
Do you have any knowledge or ideas what this could be? I could share some logs if that would be helpful, but perhaps there is an existing issue that might lead to what I am experiencing.
while trying to login with twitter as provider (using oauth v1) I receive this:
it redirect me back but I still see the auth page, not the authenticated page
cookies are there, probably the reason why I receive my user data inside the database;
also, what is this JWT_SECRET? should I add a JWT_SECRET inside the .env.local?
overall, no changes to the code other than the provider from github to twitter, I would like to try to make it work and jump to the svelte.5.0.0.next-1 and test out changes from onMount to $ effect etc with this auth.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.