Comments (14)
I have solved this issue in one line. Can I create a PR @ykdojo ?
from defaang.
I looked at the repo, and this one is exactly like the current one. Both repos use an authentication system on the client with local storage, which is a bad practice in my opinion.
Supabase provides many tools to make authentication simple, but you are using localStorage
as verification, which is not secure at all.
from defaang.
Thank you. I added a comment on #272
from defaang.
Hi 👋🏻 I could help, can you indicate me where the redirection is?
from defaang.
@Olyno thank you. Did you try finding it yourself first?
from defaang.
Actually, i got a look in the code, and got confused by how Supabase was used. I'm not sure why you're using Supabase on the server side only, while you could use on the client.
I think the way to solve your issue would be to move the auth security on the server side, and remove the session
object to use the user
object from Supabase directly, using the Supabase auth helper. I can do it for you if that's okay.
from defaang.
Actually, i got a look in the code, and got confused by how Supabase was used. I'm not sure why you're using Supabase on the server side only, while you could use on the client.
This repo will hopefully help you understand it better: https://github.com/ykdojo/supabase-nextjs-simple-auth
from defaang.
This repo will hopefully help you understand it better: ykdojo/supabase-nextjs-simple-auth
I mean, look at the pr i did, this is completely different
from defaang.
@Olyno did you look though this repo though?
from defaang.
How would you recommend that we implement this then?
from defaang.
As I said, the best would be to use the tools that Supabase offers, and to make an authentication in SSR if you use a server part. If you use only client, in this case it should be privileged that the client, but it is not your case.
You can see the implementation I recommend in PR #272
from defaang.
defaang_.recently-asked.interview.questions.at.FAANG+.collected.curated.-.Google.Chrome.2022-10-08.00-43-51.mp4
from defaang.
I tried to solve it on my local machine. My approach is to take the session as a prop and while routing the submit question using href, add a ternary check if the session is there then redirect to an add question page otherwise signup page.
from defaang.
Another way to resolve this issue is by adding private routes for the pages where we need the user should be logged in.
from defaang.
Related Issues (20)
- [FEATURE] How it Works Section to be a Responsive card HOT 2
- [FEATURE] Hover effect for how it works HOT 1
- [FEATURE] Make the header fixed for easy navigation HOT 1
- [CONTENT] Solve this problem and write out a solution for it. (or make a video) HOT 23
- [FEATURE] Embedding an online compiler/IDE into defaang for question submissions HOT 8
- [FEATURE] Add your coding platform profile while submitting question HOT 4
- [DOCS] Add a link to the sponsors page HOT 2
- [DX] Go through the issues & PRs HOT 4
- [FEATURE] Adding a "sign in" besides "sign up today" HOT 3
- [DX] Research on Firebase features HOT 3
- Adding an Owl Carousel to How it Works section HOT 1
- [DX] Copy over the project board to this new org. HOT 9
- [FEATURE] Enable Google OAuth 2.0 HOT 1
- [FEATURE] Design for View Questions [How it works] HOT 2
- [DOCS] Update the project board link in CONTRIBUTING.md HOT 5
- [PRODUCTION] Number of approved questions is not being reflected in the site HOT 1
- [DX] Look into Railway as a potential DB & backend solution HOT 3
- [FEATURE] Sticky Navbar HOT 1
- [BUG] Signup not working
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from defaang.