Updated server-side self-refrencing links to only use port when not reverse proxied.

This commit is contained in:
rainbow napkin 2025-04-26 19:14:10 -04:00
parent af982f8611
commit 46a7e9e067
3 changed files with 3 additions and 2 deletions

View file

@ -2,6 +2,7 @@
"instanceName": "Canopy",
"verbose": false,
"port": 8080,
"proxied": false,
"protocol": "http",
"domain": "localhost",
"sessionSecret": "CHANGE_ME",

View file

@ -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{

View file

@ -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{