Skip to content

Commit

Permalink
Enable editing of email send message in admin settings security and a…
Browse files Browse the repository at this point in the history
…uthentication
  • Loading branch information
LorenzoJokhan committed Jul 27, 2023
1 parent 5043eef commit 38624ac
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
28 changes: 22 additions & 6 deletions controllers/auth/url.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,31 @@ exports.login = [setNoCachHeadersMw, (req, res) => {

exports.confirmation = (req, res) => {
const config = req.client.config ? req.client.config : {};
const emailSendConfiguration = config.authTypes.EmailSend;
const configAuthType = config.authTypes && config.authTypes[authType] ? config.authTypes[authType] : {};

const title = emailSendConfiguration.title ? emailSendConfiguration.title : configAuthType && configAuthType.confirmedTitle ? configAuthType.confirmedTitle : false;

let template = emailSendConfiguration.template ? emailSendConfiguration.template : configAuthType && configAuthType.confirmedDescription ? configAuthType.confirmedDescription : false;

const loginUrl = "/login";
const client = req.client;
const clientId = req.query.clientId;
const clientEmail = client.config.contactEmail;
const redirectUrl = encodeURIComponent(req.query.redirect_uri);

template = template.replace("{{loginUrl}}", loginUrl);
template = template.replace("{{redirectUrl}}", redirectUrl);
template = template.replace("{{clientId}}", clientId);
template = template.replace("{{clientEmail}}", clientEmail);

res.render('auth/url/confirmation', {
clientId: req.query.clientId,
client: req.client,
loginUrl: '/login',
redirectUrl: encodeURIComponent(req.query.redirect_uri),
title: configAuthType && configAuthType.confirmedTitle ? configAuthType.confirmedTitle : false,
description: configAuthType && configAuthType.confirmedDescription ? configAuthType.confirmedDescription : false,
clientId: clientId,
client: client,
loginUrl: loginUrl,
redirectUrl: redirectUrl,
title: title,
description: template,
});
};

Expand Down
2 changes: 1 addition & 1 deletion views/auth/url/confirmation.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ <h1 class="">
</h1>
<p class="intro">
{% if description %}
{{description}}
{{description | safe}}
{% else %}
Bekijk uw inbox om in te loggen.
Het kan enkele minuten duren voor de e-mail verschijnt.
Expand Down

1 comment on commit 38624ac

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Published new image: openstad/auth:feature-editable-email-send-message-38624ac

Please sign in to comment.