csdojo-defaang / defaang

A website that will curate recently-asked interview questions from FAANG+. Currently inactive. Check out: https://github.com/ykdojo/OpenStream
MIT License
509 stars 120 forks source link

solved redirecting back from submission page to Homepage #275

Closed sanyamjain04 closed 1 year ago

sanyamjain04 commented 2 years ago

🛠️ Fixes Issue

Closes #271

➕ Changes Introduced

I have changed the Router method in the signup file from push to replace.

vercel[bot] commented 2 years ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
defaang ✅ Ready (Inspect) Visit Preview Oct 8, 2022 at 0:01AM (UTC)
Olyno commented 2 years ago

Hi 👋🏻 Your fix works better than my PR indeed, but you did the change at the wrongplace 😄

sanyamjain04 commented 1 year ago

Oh ya sorry, I actually did a silly mistake. Thanks @Olyno

sanyamjain04 commented 1 year ago

Now it's solved @ykdojo

sanyamjain04 commented 1 year ago

Hey, thanks for you working on it, but I don't think this is what YK addressed in the issue. Just to give you a hint, I don't think it can be done on the client side. You probably want to SSR the page on every request.

Bro this redirect thing should be done on the client side, there is no role for server-side rendering on every request. and this is what Yk has exactly mentioned on the issue. that an unauthenticated user is not able to go back after clicking on submit question button.

Olyno commented 1 year ago

I personally would prefer making the authentication part on the server side. By doing that, we don't see the redirection on the client side, it just loads the page correctly. Also, localStorage lacks of security too, it's one more reason to use on the server side.

That being said, the PR does meet the need, so I have nothing against it.

Olyno commented 1 year ago

I'm confused, why closing the pull request? @sanyamjain04

sanyamjain04 commented 1 year ago

I'm confused, why closing the pull request? @sanyamjain04

you just said that the PR doesn't meet the need.

Olyno commented 1 year ago

Nonono i said, it DOES meet the need, that's why i said it was a good PR 😄

sanyamjain04 commented 1 year ago

oh sorry, I read it wrong. I think I need some sleep 🥲🥲😂

Olyno commented 1 year ago

It's okay ahah, sorry for making it confusing 😅