coracle-social / flotilla

A nostr relay-based communities PWA modeled after discord
https://flotilla.coracle.social
MIT License
11 stars 4 forks source link

Login redirect #15

Closed staab closed 2 weeks ago

staab commented 3 weeks ago

Add redirect on successful login to the page they originally were going for

buttercat1791 commented 2 weeks ago

I'll pick this up, if it's still open.

staab commented 2 weeks ago

Go for it!

staab commented 2 weeks ago

@buttercat1791 hopefully I haven't put you out, but I was in the midst of fixing some bugs with modals and history, and I think I fixed this issue in the process. Now, when you visit the app at a particular url, it doesn't change the url on login.

buttercat1791 commented 2 weeks ago

Oh sweet! Out of curiosity, how'd you end up doing it? I was trying this morning to work with browser history, but was having a hard time keeping track of state across history pushes.

staab commented 2 weeks ago

Let me tell you, keeping track of history across pages and modals is a nightmare. Coracle uses nested modals heavily, so I've done a lot with it and I still haven't figured out how to do it "right". But in this case it was actually very simple, I just made the layout show something else based on logged in user, without modifying the url at all. So once the user logs in, they're on the page they had navigated to.