| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
Looks pretty good. Just a few suggestions for improvement.
Sorry, something went wrong.
| ); | ||
| } | ||
| if (typeof request.displayName !== 'undefined' && | ||
| typeof request.displayName !== 'string') { |
There was a problem hiding this comment.
!validator.isString()
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| }); | ||
| } | ||
| // mfaInfo has to be an array of valid AuthFactorInfo requests. | ||
| if (typeof request.mfaInfo !== 'undefined' && |
There was a problem hiding this comment.
May be this is clearer:
if (request.mfaInfo) {
if (!validator.isArray(request.mfaInfo) {
throw ...
}
request.mfaInfo.forEach...
}
Sorry, something went wrong.
There was a problem hiding this comment.
done
Sorry, something went wrong.
| let enrolledAt; | ||
| if (typeof multiFactorInfo.enrollmentTime !== 'undefined') { | ||
| if (validator.isUTCDateString(multiFactorInfo.enrollmentTime)) { | ||
| enrolledAt = new Date(multiFactorInfo.enrollmentTime).toISOString(); |
There was a problem hiding this comment.
Is there a timezone conversion happening here? Perhaps add a comment.
Sorry, something went wrong.
There was a problem hiding this comment.
Added comment.
Sorry, something went wrong.
| phoneNumber: '+16505557348', | ||
| displayName: 'Spouse\'s phone number', | ||
| factorId: 'phone', | ||
| enrollmentTime: 'invalid', |
There was a problem hiding this comment.
I expected this to throw. How is it getting silently ignored?
Sorry, something went wrong.
There was a problem hiding this comment.
Actually it only gets ignored when building the request. The client side errors are cached and will be injected in the response alongside server side response. Check test should return the expected response for import with client side errors. I added a test for this.
Sorry, something went wrong.
| uid: 'enrolledSecondFactor1', | ||
| secret: 'SECRET', | ||
| displayName: 'Google Authenticator on personal phone', | ||
| factorId: 'totp', |
There was a problem hiding this comment.
Expected to throw.
It looks like there's some pre-existing logic in the UserImportBuilder to handle these errors, and ignore them. May be we should at least log a warning when this happens, so a simple typo in the user code doesn't go completely unnoticed.
Sorry, something went wrong.
There was a problem hiding this comment.
Same here. The client side errors are cached and will be injected in the response alongside server side response. Check test should return the expected response for import with client side errors. I added a test for this too.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks. LGTM 👍
Sorry, something went wrong.
|
Thanks for the quick and helpful review! |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
WIP: Adds ability to import users with phone second factors.