From a598bca12b79be52d10e038cc832fdfea7986ce3 Mon Sep 17 00:00:00 2001 From: Chi Vinh Le Date: Mon, 29 May 2017 22:10:16 +0700 Subject: [PATCH] Allow domains with ports --- services/users.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/users.js b/services/users.js index 4c76f179c..f7f70b99e 100644 --- a/services/users.js +++ b/services/users.js @@ -568,7 +568,11 @@ module.exports = class UsersService { } let redirectDomain; try { - redirectDomain = url.parse(loc).hostname; + const {hostname, port} = url.parse(loc); + redirectDomain = hostname; + if (port) { + redirectDomain += `:${port}`; + } } catch (e) { return Promise.reject('redirect location is invalid'); }