-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow Users to Join Multiple Organizations #4984
Conversation
…viteToken to register form
…n in registration
…r and allow switching; show display name in avatar
…te multiple email addresses which are then parsed and invited
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.
Very nice work! Please see my initial comments. I'll add my observations from testing later today :)
Co-authored-by: Daniel <[email protected]>
…r message in case emails couldn't be sent
…when persisting the layout config
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.
My minor observations from testing, everything worked flawlessly otherwise:
- Visiting an invite link again, after it was used before, shows the correct message on screen but also a generic error toast: ("Couldn't find the requested resource.")
- I wonder if we could make it a little more visible which organization a user has selected. Maybe the background color of the circle could be organization-dependent. This could allow users to easily spot that they have the wrong organization activated if they switch a lot.
Due to the complexity of this change it would probably be best, if someone else would test this as well :)
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.
Wow, great stuff! 🎉
I did not test all functions yet.
app/oxalis/security/WebknossosBearerTokenAuthenticatorService.scala
Outdated
Show resolved
Hide resolved
Good point! Just pushed a fix for this.
Cool idea, but I'm a bit hesitant about the actual usefulness of differently colored icons. First, I think that most users will stay in their "main" organization (a big reason for why we built this was that some users got into the wrong organization and switching was very complicated) and thus don't need to identify the current organization using a color. Second, I think the mapping from color to actual organization is quite hard for the user. There might be power users who switch often and then can identify the color well, too, but I feel like there should be a better way to do this. For example, one could show the full (or abbreviated) organization name in the navbar somewhere. However, getting this right (UI-wise) will be a bit tricky which is why I'd like to postpone this. Is this okay? |
Yes fine for me 👍 |
* [WIP] address unused warnings * clean up some more unuseds
This reverts commit ce79449.
@philippotto if you have a minute could you have a look at the conflict in yarn.lock? (comes from #5003 ) |
Sure, I just pushed the resolved conflict. For the record, one can simply run |
@youri-k Thanks for your feedback, I implemented most of it :) Could you have another look? |
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.
I tested the described steps and everything worked flawlessly 🎉
See my small code comments
Users can now join multiple organizations, admins can now invite users by email address, skipping the manual user activation step.
TODO Backend
isDemoInstance
default in application.conf tofalse
email.logToStdout
default in application.conf tofalse
TODO Frontend
/invite/<tokenValue>
inviteToken
as additional form field) or by logging in (should do an explicit join afterwards)New Routes
GET api/auth/joinOrganization/:inviteToken
(allows the user to switchOrganization afterwards)GET api/auth/switchOrganization/:organizationName
(exchanges user cookie, rediercts to dashboard)GET api/organizations
(list all you can switch to)GET api/organizations/byInvite/:inviteToken
(list the organization you have been invited to)POST api/auth/sendInvites
expects something like{recipients: ["[email protected]”, "[email protected]"], autoActivate: false}
, for development now logs the invite token to stdoutChanged Routes
api/auth/register
has new optional form fieldinviteToken
(it is required for instances with >1 orga). It usesorganizationName
only if there is no token (to support legacy invite links for the moment) and does not useorganizationDisplayName
anymore. (Those are still used inapi/auth/createOrganizationWithAdmin
though)Steps to test:
Hint: set
mail.logToStdout = true
in application.conf to see email contents.features.isDemoInstance = true
)Issues: