Compare commits

...

2 Commits

Author SHA1 Message Date
ee7d9623a3
set redirect_after_login in query parameter as well
All checks were successful
soko-web/pipeline/head This commit looks good
2024-10-24 22:15:22 +02:00
ecec258a64
allow starttls and smtps for mailing 2024-10-19 22:44:51 +02:00
2 changed files with 8 additions and 3 deletions

View File

@ -44,8 +44,10 @@ class Mail
if (!empty($_ENV['MAIL_HOST'])) {
$mailer->Mailer = 'smtp';
$mailer->Host = $_ENV['MAIL_HOST'];
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 25;
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $_ENV['MAIL_SECURE'] : '';
$mailer->Port = !empty($_ENV['MAIL_PORT']) ? $_ENV['MAIL_PORT'] : 587;
$secureMaping = ['none' => '', 'starttls' => PHPMailer::ENCRYPTION_STARTTLS, 'smtps' => PHPMailer::ENCRYPTION_SMTPS];
$mailer->SMTPSecure = !empty($_ENV['MAIL_SECURE']) ? $secureMaping[$_ENV['MAIL_SECURE']] : '';
if (!empty($_ENV['MAIL_USER'])) {
$mailer->SMTPAuth = true;

View File

@ -168,7 +168,10 @@ class HttpResponse
private function redirectToLogin(): void
{
$this->request->session()->set('redirect_after_login', $this->rawUrl);
$response = new Redirect($this->routeCollection->getRoute($this->appConfig['loginRouteId'])->generateLink(), IRedirect::TEMPORARY);
$response = new Redirect(
$this->routeCollection->getRoute($this->appConfig['loginRouteId'])
->generateLink(['redirect_after_login' => urlencode($this->rawUrl)]),
IRedirect::TEMPORARY);
header('Location: ' . $this->getRedirectUrl($response), true, $response->getHttpCode());
}