Allow domains with ports

This commit is contained in:
Chi Vinh Le
2017-05-29 22:10:16 +07:00
parent bdbc7c5ff2
commit a598bca12b
+5 -1
View File
@@ -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');
}