diff --git a/src/routes/account.js b/src/routes/account.js index 01f293d..851f2b3 100644 --- a/src/routes/account.js +++ b/src/routes/account.js @@ -112,7 +112,13 @@ router.get('/register', async (request, response) => { }); router.post('/register', async (request, response) => { - const { email, username, mii_name, password, password_confirm, 'h-captcha-response': hCaptchaResponse } = request.body; + const { email, username, mii_name, birthday, password, password_confirm, 'h-captcha-response': hCaptchaResponse } = request.body; + + // * IP must be forwarded to the account server so we can check for age related issues based on region. + // * This is NEVER recorded in our records, ever. See https://github.com/PretendoNetwork/account/pull/194 + // * for more details. Once the IP is used to query for location, both the IP and location are disregarded + // * and no data is stored for blocked users + const ip = request.ip; // TODO - Enable `CF-IPCountry` in Cloudflare and only use this as a fallback response.cookie('email', email, { domain: '.pretendo.network' }); response.cookie('username', username, { domain: '.pretendo.network' }); @@ -120,9 +126,11 @@ router.post('/register', async (request, response) => { try { const tokens = await util.register({ + ip, email, username, mii_name, + birthday, password, password_confirm, hCaptchaResponse diff --git a/src/server.js b/src/server.js index c48e7be..bb8765a 100644 --- a/src/server.js +++ b/src/server.js @@ -19,6 +19,8 @@ const { http: { port } } = config; const app = express(); // const stripe = new Stripe(config.stripe.secret_key); +app.set('trust proxy', true); // TODO - Make this configurable + logger.info('Setting up Middleware'); app.use(morgan('dev')); // app.use(express.json()); diff --git a/views/account/register.handlebars b/views/account/register.handlebars index b8daa80..e4be193 100644 --- a/views/account/register.handlebars +++ b/views/account/register.handlebars @@ -23,6 +23,11 @@ +
+ {{! TODO - Add this to weblate, hard-coding for now to just push it out }} + +
+