diff --git a/config.example.json b/config.example.json index 42c171d..0afa5f4 100644 --- a/config.example.json +++ b/config.example.json @@ -2,6 +2,7 @@ "instanceName": "Canopy", "verbose": false, "port": 8080, + "proxied": false, "protocol": "http", "domain": "localhost", "sessionSecret": "CHANGE_ME", diff --git a/src/schemas/user/emailChangeSchema.js b/src/schemas/user/emailChangeSchema.js index 96bf5d2..ca20900 100644 --- a/src/schemas/user/emailChangeSchema.js +++ b/src/schemas/user/emailChangeSchema.js @@ -134,7 +134,7 @@ emailChangeSchema.methods.consume = async function(){ emailChangeSchema.methods.getChangeURL = function(){ //Check for default port based on protocol - if((config.protocol == 'http' && config.port == 80) || (config.protocol == 'https' && config.port == 443)){ + if((config.protocol == 'http' && config.port == 80) || (config.protocol == 'https' && config.port == 443 || config.proxied)){ //Return path return `${config.protocol}://${config.domain}/emailChange?token=${this.token}`; }else{ diff --git a/src/schemas/user/passwordResetSchema.js b/src/schemas/user/passwordResetSchema.js index 31bd9aa..85ef296 100644 --- a/src/schemas/user/passwordResetSchema.js +++ b/src/schemas/user/passwordResetSchema.js @@ -106,7 +106,7 @@ passwordResetSchema.methods.consume = async function(pass, confirmPass){ passwordResetSchema.methods.getResetURL = function(){ //Check for default port based on protocol - if((config.protocol == 'http' && config.port == 80) || (config.protocol == 'https' && config.port == 443)){ + if((config.protocol == 'http' && config.port == 80) || (config.protocol == 'https' && config.port == 443) || config.proxied){ //Return path return `${config.protocol}://${config.domain}/passwordReset?token=${this.token}`; }else{