feat: Multi-account switching & self-hosted/on-premise instances#999
feat: Multi-account switching & self-hosted/on-premise instances#999Pecacheu wants to merge 7 commits into
Conversation
|
I'm currently working on a similar feature, but instead of making an account switcher, I'm trying to make adding servers from other instances to the sidebar possible. I've done some preliminary work here, but I'm still far from finished. I've actually been struggling to come up with a good way of managing things like user settings that are instance-specific but not server-specific, so maybe we can coordinate to make both features work together. |
Interesting- I could see both of those features working together, yes. I think the way I'm handling swapping between user tokens could be extended to apply to other stored user settings too. |
d14c2fb to
ab62f3b
Compare
|
Aight so @Gtoasted is now using an API call to fetch all the other endpoint URLs, so I can make a big improvement here UI-wise. Still experimenting with how to redirect all navigation though. |
|
Eureka, it actually works now! (Mostly) |
True. I was inspired by the collapsable UI found in some other login screens, but the text would probably fit much better inside a modal in this case. I'll give that a go.
I like the proxy wording and used that, but personally I think the "on-prem" wording feels a bit too corporate. Not that we can't acknowledge corporate use, it is definitely a common use-case for on-premise hosting, I just feel it shouldn't be worded as if that's the only people who use it, confusing some poor guy just trying to sign into some self-hosted Minecraft server chat instance. How about something like:
It's also still a good idea to have some sort of content hosting warning like above. It disavows any liability to certain types of content (you know which kind I mean) being discovered on some mega-creep's instance. #notalawyer but my pleb understanding is that in many jurisdictions, a clear warning needs to be shown to the user for this type of thing, i.e. a notice buried in some license policy doesn't count, it has to be something you click "OK" or "Accept" to. (Then again, clearly the "Here's a link to this 500 page ToS you obviously won't read, do you accept?" approach counts.) But please do reword it, again not an expert. |
|
Known issue: There seems to be some overriding behavior happening with the settings stores- They write to the correct instance's store, but read still seems to pull from the base store. I suspect that the keys are being overwritten during the hydration phase. |
|
hey @Pecacheu are there any issues here that need resolving? |
There is the one known issue above, tho it might be hard to solve without being familiar with the code already. I was planning to address it next time I have some time to work on Stoat stuff. Overall though this is looking pretty solid/stable, it has come a long way. You can always help by simply testing it out and seeing if you run into any other issues, though! |
95a24fd to
d4087e9
Compare
a9bf347 to
11d5672
Compare
efb9bd1 to
72b90d4
Compare
def0316 to
73391dd
Compare
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
Signed-off-by: Jacob Schlecht <dadadah@echoha.us>
65f0c78 to
fc9fd04
Compare
719ba1e to
2556233
Compare
160581f to
d4f2398
Compare
28217ea to
a9d1c87
Compare
refactor: use Instance.apiUrl instead of CONFIGURATION.DEFAULT_API_URL refactor: use Instance.wsUrl instead of CONFIGURATION.DEFAULT_WS_URL refactor: use Instance.mediaUrl instead of CONFIGURATION.DEFAULT_MEDIA_URL refactor: use Instance.proxyUrl instead of CONFIGURATION.DEFAULT_PROXY_URL refactor: use Instance.gifboxUrl instead of CONFIGURATION.DEFAULT_GIFBOX_URL refactor: use Instance.isStoat instead of CONFIGURATION.IS_STOAT refactor: use Instance.hcaptcha_sitekey instead of CONFIGURATION.HCAPTCHA_SITEKEY refactor: use Instance.maxEmoji instead of CONFIGURATION.MAX_EMOJI refactor: use Instance.enableVideo instead of CONFIGURATION.ENABLE_VIDEO chore: take note of remaining variables to be implemented in instance.ts chore: fix formatting feat: add hostname to Instance.ts feat: modify routes to allow access to other instances Signed-off-by: Gtoasted <git@gtoasted.de>
fix: Use instance global limits in Draft.ts because it is outside of the ClientController context refactor: Move client init from Lifecycle into Instance so that the configuration is only pulled once fix: Use instance prop for server emoji limit Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>
- "Add an account" button in Settings -> My Account - "Switch Accounts" button in user context menu, if multiple accounts are stored - "Log out" button only logs out the current account, switches to next stored one if present - Account tokens stored via modified schema for 'auth' key in Auth manager - Last known name and pfp are cached, because alt accounts might not have privilege to fetch them from the API fix: Apply patches from multiuser fix: TS error caused by rebase fix: Move unused host var to multi-instance PR - Define class var at top - Remove debug lines refactor: Use new breakpoints on login screen fix: Lifecycle transitions slightly borked by PR 1197, causing random logouts fix: Separate logout wo/ delSes Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>
fix: Makin the fields actually work feat: Prep for instance param in URL - Fix smDown in wrong place in FlowBase - Change route from /instance/ to /i/ to keep links shorter since it will be prepended to everything - Rename hostname to host because it could also contain a port number - Add navigate and setNext to instance fix: Show progress wheel instead of auth page while switching accounts - Also add a back button to the auth page that only appears when in "add an account" mode and not on first login revert: Undo committed temp change fix: Undefined error in state index fix: Working redirects - Relative path is redirected to instance-specific path - Remove unused Instance.navigate, add relPath and switchTo - Async API endpoint fetch, currently showing any error in alert() prompt because modals don't work at root level - Use Dynamic element to force reload of context when instance changes fix: "Copy link" option supports self-hosted instances - All links now use `https://stoat.chat/i/host` prefix, allowing easy and uniform detection when cross-posting links- Eg. clicking a link from another instance redirects client to that instance. - instance.href method now generates full URL by default - Use instance.href instead of location.origin to ensure consistency in app hosted on different domain to the instance's API domain fix: Formatting. Just prettier being a bit silly fix: Normalize import order in changed files fix: "Message" option in context menu broken on alternate instances fix: Fixes for alt instances - Add global stores and make 'auth' store global - Store host param in session data - Auto-switch instance if current session doesn't match - Replace "Advanced" dropdown with modal - Delete session on "OK" if invalid session error - Fix buttons not highlighting in Home sidebar on alt instance fix: We shall unite all as one! - Support cross-instance channel/server/invite links (Builds on work in PR 1037) - Auto-redirect to appropriate instance as needed, logging into most recent saved account on instance - Fix regex for paramsFromPathname to support instance prefix - Fix annoying draft console logging chore: Fix anchor imports to prevent merge conflict fix: Switching to user on another instance while in a server causes lastActivePath to get set to wrong value - Fix non-reactivity warn on app routes - Improve error handling and display during login/auth flows fix: Pull more info from API - Pull enableVideo and maxAttachments from API so they update when swapping instance - Remove unused CONFIGURATION vars - Move snackbar provider to root - Switch auth error from alert diag to snackbar fix: Use instance in ServerRoleEditor fix: Alternate settings db per-user instead of only per-instance - Fix global db overriding local db at per-key-level instead of store-level fix: Update for rebase refactor: Updates for feat/apiroute fix: Better connection error fix: Cross-instance re-login & remote link click issues Signed-off-by: Pecacheu <3608878+Pecacheu@users.noreply.github.com>




Dependencies
Related Discussions
Current UI concept
Test this live at https://forestfire.net:420
Feel free to give it a test if you've got a self-hosted instance and let me know how it goes!