feat: login / signup in rill developer
- [x] Add
GetCurrentUserendpoint to get info similar to cloud. - [x] Add
/auth/logoutendpoint for logout and to clear the token stored locally. Also logs out of cloud ui. - [x] Add
LocalAvatarButtonthat calls the above endpoints and is shown in dashboard (will be moved to use global header in a future PR)
This PR doesnt add pylon to rill developer, this will be in a separate PR
Intent discussed with @jkhwu was for the logged out state to also appear on non-preview screens in Rill dev (see the last variant of the component). Just wanted to clarify that with you in case it was not obvious: https://www.notion.so/rilldata/Logged-out-state-in-Rill-Developer-4add186ff5e649c1b526ed4fdc788608?pvs=4
Also, can we put this behind a feature flag? Given it doesn't provide much value to our users without the rest of the deploy flow, it's best to hide
@ericokuma @ericpgreen2 Updated to add the avatar button in metrics view editor. Also updated logout to logout from cloud ui as well.
Looks great! Here are some items I found:
- When logging out, there's a loading state but on the "Preview" button. @jkhwu, what should be the appropriate behavior here? On the avatar? https://www.loom.com/share/ae865da6814d495b8eb04555416a30c9?sid=ae06b0d1-5b62-452a-b42c-1c48f69ccaa6
- There's also no loading state when viewing a dashboard.
-
No logged-in avatar in this view. @jkhwu, can you add the desired location here?
-
No logged-in avatar in other views: rill.yaml, README.md, .gitignore, sources, models
@ericokuma Fix for 1 is in a separate PR (it was unrelated to this): #5166 Shall we take the follow ups in a new PR?
I'm having trouble testing this in dev mode.
First attempt
Per your instructions, I did:
make cli./rill devtool start cloud./rill start <project>
When trying to log-in via the browser, I hit this 500 error:
Second attempt
I also tried:
make cli./rill devtool start cloud- In
web-local/package.json, I editedvite devtovite dev --port 3001 ./rill devtool start local
Then when logging in via the browser, I hit this 404 error:
In this^ case, I wonder if the trailing slash after auth is causing the issue?
Double-checking, did you see Okuma's comment? I'm not yet seeing the feature flag in the code.
Also, can we put this behind a feature flag? Given it doesn't provide much value to our users without the rest of the deploy flow, it's best to hide
Since we are not merging for the current release (~3rd july), doesnt make sense to add the feature flag.
I'm having trouble testing this in
devmode.
Fixed by https://github.com/rilldata/rill/pull/5233
Code looks good. My main UX observation is that the avatar is not shown on all pages. I see that you'll switch to a global header in a follow-on PR. That works – just noting that IMO the avatar needs to be shown on all pages before this is released.
Tagging @ericokuma for final UX review & approval
I'm getting a 404 when I click on the Login/Signup option under the avatar
Also agree with @ericpgreen2 that the avatar should be present in the top right of every page in Rill Developer.
Looks like it's currently only on the following pages:
- metric .yamls
- dashboards
- We'll need the avatar to also appear on this page. @jkhwu, for now it's just a floating avatar in the top right?
Also:
-
the avatar disappears for a a couple of secs after I login
-
we probably need a loading state for when user logs out to indicate confirmation that of user clicking on logout
https://www.loom.com/share/a519da4a60044144a213ed6d868ca224?sid=d7827a0e-c966-49cd-87f4-ebe4cae487fa
Funky behavior between Rill Developer and Rill Cloud:
- If I'm logged into Rill Cloud, then refresh on my Rill Developer, it doesn't detect my logged in state. Only when I click on login/signup in Rill Developer does it pull my Rill Cloud auth
- If I log out of Rill Cloud, then refresh on my Rill Developer, it gets into a weird state that says "avatar". When I refresh, it displays my profile image and remains logged in.
https://www.loom.com/share/e2be5e94d56d4fc19348bde09d33a337?sid=4602f307-3c99-4a5b-b9d5-efaba61c1656
- When I am logged into both Rill Cloud and Rill Developer and then log out of Rill Developer, then log out of Rill Cloud. When I try logging back into Rill Cloud, it ends up taking me to a weird admin.rilldata.com page
https://www.loom.com/share/6da4f8dc86af419babb5a8aa46d28890?sid=aca4b07d-6772-4151-a4d2-e258f67945bb
UXQA:
- Loading state functionally is good! I was thinking of a different loading spinner. The one I'm thinking of is not the cube spinner but the circle spinner inside of buttons. But this works for now. We can come back to it after!
- Looks like the avatar is on every page except for Connector tables
- Loading icon and avatar display after login auth is a bit jumpy https://www.loom.com/share/9311077101394a80b6682afa9ec54b34?sid=dfea1a15-ccb8-4e15-bd43-9781c7e32b64