Giter Site home page Giter Site logo

Comments (14)

sanyamjain04 avatar sanyamjain04 commented on August 13, 2024 1

I have solved this issue in one line. Can I create a PR @ykdojo ?

from defaang.

Olyno avatar Olyno commented on August 13, 2024 1

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.

ykdojo avatar ykdojo commented on August 13, 2024 1

Thank you. I added a comment on #272

from defaang.

Olyno avatar Olyno commented on August 13, 2024

Hi 👋🏻 I could help, can you indicate me where the redirection is?

from defaang.

ykdojo avatar ykdojo commented on August 13, 2024

@Olyno thank you. Did you try finding it yourself first?

from defaang.

Olyno avatar Olyno commented on August 13, 2024

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.

ykdojo avatar ykdojo commented on August 13, 2024

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.

Olyno avatar Olyno commented on August 13, 2024

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.

ykdojo avatar ykdojo commented on August 13, 2024

@Olyno did you look though this repo though?

from defaang.

ykdojo avatar ykdojo commented on August 13, 2024

How would you recommend that we implement this then?

from defaang.

Olyno avatar Olyno commented on August 13, 2024

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.

Akshay1018 avatar Akshay1018 commented on August 13, 2024
defaang_.recently-asked.interview.questions.at.FAANG+.collected.curated.-.Google.Chrome.2022-10-08.00-43-51.mp4

from defaang.

Akshay1018 avatar Akshay1018 commented on August 13, 2024

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.

Akshay1018 avatar Akshay1018 commented on August 13, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.