Skip to content

Commit

Permalink
add return email URL to .env
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamie committed Oct 25, 2022
1 parent de6d402 commit 4af1eea
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion assets/setup/env.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@
if (!defined('MAIL_USERNAME')) define('MAIL_USERNAME', '[email protected]');
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);
if (!defined('MAIL_PORT')) define('MAIL_PORT', 465);
if (!defined('EMAIL_RETURN_URL')) define('EMAIL_RETURN_URL', 'https://mysite.com/loginsystem');
2 changes: 1 addition & 1 deletion register/includes/sendverificationemail.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)';


Expand Down
2 changes: 1 addition & 1 deletion reset-password/includes/sendtoken.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down
2 changes: 1 addition & 1 deletion verify/includes/sendverificationemail.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit 4af1eea

Please sign in to comment.