Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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', '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);
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