-
Notifications
You must be signed in to change notification settings - Fork 33
#28: Check email validity when linking existing PNID #130
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
base: dev
Are you sure you want to change the base?
Conversation
This commit adds a check after the username/password check to ensure the submitted email matches the user's email. Fixes: PretendoNetwork#28
this didn't make it into the original commit somehow
middleware is used outside of initial link, so skip checking email if email header is not set
|
So sorry for the late review, I didn't see this until now. I think this should be fine, @DaniElectra look good to you? |
|
@jonbarrow I completely forgot about this. Maybe I should start doing more with pretendo... |
| return; | ||
| } | ||
|
|
||
| if (email != undefined && pnid.email.address !== email) { |
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.
This can be bypassed with a custom client if it doesn't add the x-nintendo-email header. I'd move this code to where the linking takes place
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 my memory serves, there are many times where this route is called but an email is never specified (I believe in eShop login and Wii u logins). So the purpose of this is less to improve security (which was fine because a username/password combination is still required) and more to restore proper functionality where expected (when email+username login is used).
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'm fairly certain Dani means to move it from middleware to the route handler itself. Which, in hindsight, I agree with
Resolves: #28
Changes:
This commit adds a check after the username/password check to ensure the submitted email matches the user's email.
The error code (022-2613 / 1105 in source code) is correct for any case where username/password/email are incorrect according to Nintendo.