Skip to content
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

Make user names cleaner #357

Closed
adelavega opened this issue Sep 14, 2022 · 9 comments
Closed

Make user names cleaner #357

adelavega opened this issue Sep 14, 2022 · 9 comments

Comments

@adelavega
Copy link
Member

Currently they are ugly oauth2 IDs

@nicoalee
Copy link
Collaborator

  • change user names to name instead of user.sub

@nicoalee nicoalee added enhancement New feature or request high-priority labels Sep 15, 2022
@nicoalee nicoalee self-assigned this Sep 15, 2022
@nicoalee
Copy link
Collaborator

nicoalee commented Sep 16, 2022

@jdkent I don't think this task is super straighforward. When a user clones a study, we save their given auth0 ID (user.sub).

The easiest solution would be to save the user's name/username when they clone the study. However, this may eventually be out of date if the user changes their name/username at a later time.

Otherwise, could we use auth0 and force users to come up with a unique username that they would use? How is it done in neuroscout @adelavega ?

@jdkent
Copy link
Member

jdkent commented Sep 19, 2022

I think Auth0 has a mechanism to access the name field.
Here is an example for the development server:

get name field from Auth0 (using the management api token)

https://dev-mui7zm42.us.auth0.com/api/v2/users/auth0%7C62e0e6c9dd47048572613b4d?fields=name&include_fields=true

Management API token

using the auth0 management api token from here: https://manage.auth0.com/dashboard/us/dev-mui7zm42/apis/60f60987000aa700428537c5/test

What could be a solution is adding an endpooint to /users/ where a PUT request would call auth0 to update there and update our database at the same time.

@nicoalee
Copy link
Collaborator

@jdkent It's trivial to get the name of the user currently logged in; however, what about the list of studies that have a sourceId (a user cloned the study)?
When we display public studies in the search page, those other auth0 IDs belonging to other users will be displayed.

image

@nicoalee
Copy link
Collaborator

What could be a solution is adding an endpooint to /users/ where a PUT request would call auth0 to update there and update our database at the same time.

Another solution would just be to do a mapping on the frontend. We can gather all userIDs that are displayed on the page and call the management API: https://auth0.com/docs/manage-users/user-search/retrieve-users-with-get-users-endpoint

@nicoalee
Copy link
Collaborator

@jdkent @nicoalee

Update:

Our solution will be to create a displayName column in the backend user table.
This property will be added to the study return object and any other object that the user owns (studysets, meta-analyses, etc)

This will replace the FE auth0IDs for a more user friendly visual.

In the future, we will want to be able to update their profile and give them the ability to update their display name

@nicoalee
Copy link
Collaborator

still a WIP

@nicoalee nicoalee moved this from In Progress to Todo in Neurosynth 2.0 Project Map May 19, 2023
@adelavega
Copy link
Member Author

Related: #487

@nicoalee nicoalee moved this from Todo to In Progress in Neurosynth 2.0 Project Map Aug 8, 2023
@nicoalee nicoalee added the blocked cannot work on this as there is a dependency label Aug 22, 2023
@nicoalee nicoalee removed the blocked cannot work on this as there is a dependency label Sep 11, 2023
@nicoalee
Copy link
Collaborator

completed via #197

@github-project-automation github-project-automation bot moved this from In Progress to Done in Neurosynth 2.0 Project Map Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

When branches are created from issues, their pull requests are automatically linked.

3 participants