-
Notifications
You must be signed in to change notification settings - Fork 0
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
BCeID FN LN Issue Fix #243
Conversation
app/src/services/user.ts
Outdated
@@ -27,12 +27,15 @@ const service = { | |||
.filter((claims) => claims) // Drop falsy values from array | |||
.concat(undefined)[0]; // Set undefined as last element of array | |||
|
|||
const firstName = token.given_name.split(' ')[0]; | |||
const lastName = token.family_name.trim().length > 0 ? token.family_name : token.given_name.split(' ')[1]; |
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.
If someone is named Jim Joe Smith
, this would only store Joe
as their last name, and Smith
would be omitted entirely.
This will also array out of bounds in the possibility a user comes in with only a single word for their given_name
and no family_name
.
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.
We cannot do this - anything we get from the JWT is canonical in nature and should not be manipulated under any circumstances when storing it in our system. We should not be interpreting the values in here because we do not have the authority to do so.
8724a87
to
27ff536
Compare
5d7c5f6
to
1878549
Compare
const contactSchema = object({ | ||
firstName: string().required().max(255).label('First name'), |
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.
should we start using i18n for validation schemas?
1878549
to
f010853
Compare
Description
PADS-436
BCeID was passing both fn and ln in given_name, now we're splitting it on space to fn and ln.
Types of changes
Bug fix (non-breaking change which fixes an issue)
Checklist
Further comments