mirror of
https://github.com/PretendoNetwork/account.git
synced 2026-10-02 23:27:56 -05:00
feat(NNAS): add user country sanity check people endpoint
This commit is contained in:
@@ -322,6 +322,35 @@ router.post('/', deviceRatelimit, deviceCertificateMiddleware, async (request: e
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO - Check against the list of valid countries
|
||||
if (!person.country) {
|
||||
response.status(400).send(xmlbuilder.create({
|
||||
errors: {
|
||||
error: {
|
||||
cause: 'country',
|
||||
code: '0002',
|
||||
message: 'country format is invalid'
|
||||
}
|
||||
}
|
||||
}).end());
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO - I think region locking is a stupid idea here, but in case we ever want it here it is
|
||||
// * if (person.country does not match console country header/etc.) {
|
||||
// * response.status(400).send(xmlbuilder.create({
|
||||
// * errors: {
|
||||
// * error: {
|
||||
// * code: '0107',
|
||||
// * message: 'Account country and device country do not match'
|
||||
// * }
|
||||
// * }
|
||||
// * }).end());
|
||||
// *
|
||||
// * return;
|
||||
// * }
|
||||
|
||||
const creationDate = moment().format('YYYY-MM-DDTHH:MM:SS');
|
||||
let pnid: HydratedPNIDDocument;
|
||||
let nexAccount: HydratedNEXAccountDocument;
|
||||
|
||||
Reference in New Issue
Block a user