Updated server-side self-refrencing links to only use port when not reverse proxied.
This commit is contained in:
parent
af982f8611
commit
46a7e9e067
|
|
@ -2,6 +2,7 @@
|
||||||
"instanceName": "Canopy",
|
"instanceName": "Canopy",
|
||||||
"verbose": false,
|
"verbose": false,
|
||||||
"port": 8080,
|
"port": 8080,
|
||||||
|
"proxied": false,
|
||||||
"protocol": "http",
|
"protocol": "http",
|
||||||
"domain": "localhost",
|
"domain": "localhost",
|
||||||
"sessionSecret": "CHANGE_ME",
|
"sessionSecret": "CHANGE_ME",
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ emailChangeSchema.methods.consume = async function(){
|
||||||
|
|
||||||
emailChangeSchema.methods.getChangeURL = function(){
|
emailChangeSchema.methods.getChangeURL = function(){
|
||||||
//Check for default port based on protocol
|
//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 path
|
||||||
return `${config.protocol}://${config.domain}/emailChange?token=${this.token}`;
|
return `${config.protocol}://${config.domain}/emailChange?token=${this.token}`;
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ passwordResetSchema.methods.consume = async function(pass, confirmPass){
|
||||||
|
|
||||||
passwordResetSchema.methods.getResetURL = function(){
|
passwordResetSchema.methods.getResetURL = function(){
|
||||||
//Check for default port based on protocol
|
//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 path
|
||||||
return `${config.protocol}://${config.domain}/passwordReset?token=${this.token}`;
|
return `${config.protocol}://${config.domain}/passwordReset?token=${this.token}`;
|
||||||
}else{
|
}else{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue