Closed dtbuchholz closed 6 months ago
This PR was not deployed automatically as @dtbuchholz does not have access to the Railway project.
In order to get automatic PR deploys, please add @dtbuchholz to your team on Railway.
@asutula lmk if this PR makes sense! i felt having the auto redirect was better for the UX because when i log in, it makes it easier to just go to the Studio app's core logic vs having to click the Home button.
edit: looks like some linting fixes are needed...i can clean that up if you think the logic is worthwhile adding.
Cool, thanks for this. Will take a look. It definitely used to redirect to your personal team page after login, so not sure why that changed, but great to get it back in working order.
cool, sgtm. i did just notice an issue with my logic, so you can kind of disregard my fix, actually. it fixes only the login redirect to your personal slug, but then it adds a new issue where it does that for all other routes lol. so this is worse than before.
I've looked into this and have found one case where it seems like our redirect behavior was broken. If you are authenticated with the Studio server, but your wallet is disconnected for any reason, then you reconnect your wallet, you'd expect to be redirected to your team page, but this wasn't happening. I added a fix for that to #240 in this commit https://github.com/tablelandnetwork/studio/pull/240/commits/c2d9bcd0bd934c9b7f661b9cbc82f3b6de8fad95.
I think we handle redirecting on auth correctly otherwise. Closing this PR, but let me know if you notice any strange behavior in the future.
Summary
When you log into the studio at the root endpoint, it doesn't redirect to my profile. This is confusing because as a user, I have to know that I must click the "Home" button in order to get to the correct route and show Studio functionality. This adds logic to redirect to the personal team route if the user has signed in.
Details
For reference, here is a video of how the existing logic works. When you're signed in and go to the studio URL, it doesn't redirect anywhere, and you have to click "Home". (The new logic is shown down below, with a note.)
https://github.com/tablelandnetwork/studio/assets/13358940/733a7093-e116-47bc-b907-26537b172452
A simple change in the
profile
component adds this logic:vs.
Errors
I noticed that with both the exsting logic and the new logic implemented here, you can (very occasionally) run into a tRPC error upon signing in. The video shows how the new logic redirects to the personal team slug upon initial connections or subsequent sign ins. But, if you sign out and sign back really quickly, you'll sometimes run into an error:
Here's the video. The error occurs at the 40 second mark after repeated sign ins/outs, but after the error is shown, you can still successfully log in w/o issue. Thus, this seems like an edge case that shouldn't impact this PR imo.
https://github.com/tablelandnetwork/studio/assets/13358940/700e1e6a-9436-438f-be44-fa5c46a4be56