diff --git a/assets/setup/env.php b/assets/setup/env.php index 15f4e41..e0c83bd 100644 --- a/assets/setup/env.php +++ b/assets/setup/env.php @@ -17,4 +17,5 @@ if (!defined('MAIL_USERNAME')) define('MAIL_USERNAME', 'example.email@gmail.com'); if (!defined('MAIL_PASSWORD')) define('MAIL_PASSWORD', 'example-password'); if (!defined('MAIL_ENCRYPTION')) define('MAIL_ENCRYPTION', 'ssl'); -if (!defined('MAIL_PORT')) define('MAIL_PORT', 465); \ No newline at end of file +if (!defined('MAIL_PORT')) define('MAIL_PORT', 465); +if (!defined('EMAIL_RETURN_URL')) define('EMAIL_RETURN_URL', 'https://mysite.com/loginsystem'); \ No newline at end of file diff --git a/register/includes/sendverificationemail.inc.php b/register/includes/sendverificationemail.inc.php index a6708d7..f927250 100644 --- a/register/includes/sendverificationemail.inc.php +++ b/register/includes/sendverificationemail.inc.php @@ -14,7 +14,7 @@ $selector = bin2hex(random_bytes(8)); $token = random_bytes(32); - $url = "localhost/loginsystem/verify/includes/verify.inc.php?selector=" . $selector . "&validator=" . bin2hex($token); + $url = EMAIL_RETURN_URL . "/verify/includes/verify.inc.php?selector=" . $selector . "&validator=" . bin2hex($token); $expires = 'DATE_ADD(NOW(), INTERVAL 1 HOUR)'; diff --git a/reset-password/includes/sendtoken.inc.php b/reset-password/includes/sendtoken.inc.php index e50547f..cdb64e0 100644 --- a/reset-password/includes/sendtoken.inc.php +++ b/reset-password/includes/sendtoken.inc.php @@ -46,7 +46,7 @@ $selector = bin2hex(random_bytes(8)); $token = random_bytes(32); - $url = "localhost/loginsystem/reset-password/?selector=" . $selector . "&validator=" . bin2hex($token); + $url = EMAIL_RETURN_URL . "/reset-password/?selector=" . $selector . "&validator=" . bin2hex($token); $expires = 'DATE_ADD(NOW(), INTERVAL 1 HOUR)'; $email = $_POST['email']; diff --git a/verify/includes/sendverificationemail.inc.php b/verify/includes/sendverificationemail.inc.php index 0c8ac0d..bda02db 100644 --- a/verify/includes/sendverificationemail.inc.php +++ b/verify/includes/sendverificationemail.inc.php @@ -45,7 +45,7 @@ $selector = bin2hex(random_bytes(8)); $token = random_bytes(32); - $url = "localhost/loginsystem/verify/includes/verify.inc.php?selector=" . $selector . "&validator=" . bin2hex($token); + $url = EMAIL_RETURN_URL . "/verify/includes/verify.inc.php?selector=" . $selector . "&validator=" . bin2hex($token); $expires = 'DATE_ADD(NOW(), INTERVAL 1 HOUR)'; $email = $_SESSION['email'];