-
Notifications
You must be signed in to change notification settings - Fork 26
Redirect non-authenticated users to About page #1483
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1483 +/- ##
========================================
Coverage 79.11% 79.12%
========================================
Files 70 71 +1
Lines 5229 5413 +184
========================================
+ Hits 4137 4283 +146
- Misses 1092 1130 +38 🚀 New features to boost your workflow:
|
datalab
|
||||||||||||||||||||||||||||
| Project |
datalab
|
| Branch Review |
bc/default-page
|
| Run status |
|
| Run duration | 08m 37s |
| Commit |
|
| Committer | Ben Charmes |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
458
|
| View all changes introduced in this branch ↗︎ | |
4725a40 to
58d850f
Compare
ml-evs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works well, thanks!
ml-evs
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, actually, just testing it a bit and realising that every load page now hits /get-current-user 3 times, with this PR adding the extra one... could you take a look at this and make better use of the store/cache and the setCurrentUserInfoLoading state in the store?
58d850f to
f2827d4
Compare
Moved the auth logic into a Vuex action that stores the in-flight Promise in state. This prevents the 3 concurrent |
40f55b4 to
c6c703f
Compare
webapp/src/store/index.js
Outdated
|
|
||
| commit("setCurrentUserInfoLoading", true); | ||
|
|
||
| const promise = fetch(`${API_URL}/get-current-user/`, { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry to be a pain but I'd rather all the direct API fetches are done in server_fetch_utils, we likely need to use the fetch_get wrapper there anywhere.
Could you put this back there and manage the store state upon request?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking another quick look at where else this is used in the code, we need to make sure we can invalidate the user info cache when the user changes their own info, for e.g.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries, of course, it makes more sense!
I've moved back the fetch logic to server_fetch_utils with a cache system to prevent multiple /get-current-user/ calls. The cache is invalidated when users update their info in EditAccountSettingsModal.
I kept the fetchCurrentUser action in the store to handle the fullInfo parameter and return cached data when available. Let me know if you'd prefer a different approach - happy to adjust!
c6c703f to
f2827d4
Compare
Closes #492
Changes default landing page behavior based on authentication status.