-
Notifications
You must be signed in to change notification settings - Fork 2
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
Create updateUserAfterRegistration endpoint #293
Conversation
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.
Looking good David. I'm just trying to wrap up the required methods for patron creation on HttpSierraClient right now, i'll have a think about | p
I'm assuming we'll want it on patron creation
Can you add a comment about why this is a new endpoint? Reading the PR, I was initially against it as it's not very RESTful at all and it's definitely duplication, but I changed my mind because I thought (a) it seems reasonable that these endpoints will diverge (eg, we might want to send transactional emails here at some point in future) and (b) we can do a check that the user is at the correct stage of the signup process here. |
Further thoughts:
|
Does it make sense to send the whole prefixed id (e.g. |
This endpoint needs to match the others in the API - the |
I think I've addressed the comments with the exception of the API gateway stuff (which I think I'd prefer to do and understand in a separate PR). |
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.
Lovely!
Part of wellcomecollection/wellcomecollection.org#7808
Opted to create a new endpoint and handler instead of wrapping
updateUser
in conditionals based on whether we've got a password or not.I think the
user_id
we're going to pass from the NextJS app will be prefixed withauth0|
and I imagine we'll need to strip this off in order for thegetTargetUserId
function not to blow up. I've seen elsewhere we're checking if it starts withauth0|p
– I'm not sure where thatp
comes from (and it doesn't appear in the ids that I've been testing with)Edit: I've removed the
auth0|
(and maybep
) before it gets this far. I guess thep
is for 'patron', although I wasn't sure if it would be added to newly created Sierra-database records using Auth0 as a way to signup, so left it optional for now. If we know the prefix either definitely will or will not contain ap
, we can remove the?
or thep
from the regex, respectively.