refs #6067 feat: url model to everyone
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Alex Moreno 2023-10-03 09:36:11 +02:00
parent 62fa54e02f
commit 8c39f65dc3
4 changed files with 14 additions and 8 deletions

View File

@ -21,5 +21,12 @@
"type": "string", "type": "string",
"required": true "required": true
} }
} },
"acls": [{
"accessType": "READ",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW"
}]
} }

View File

@ -221,12 +221,6 @@ module.exports = function(Self) {
{environment: env} {environment: env}
]} ]}
}); });
const hederaUrl = await Self.app.models.Url.findOne({
where: {and: [
{appName: 'hedera'},
{environment: env}
]}
});
const isWorker = instance.isWorker || await Self.app.models.Account.findById(instance.id, null, ctx.options); const isWorker = instance.isWorker || await Self.app.models.Account.findById(instance.id, null, ctx.options);
class Mailer { class Mailer {
@ -246,7 +240,7 @@ module.exports = function(Self) {
type: 'email', type: 'email',
to: newEmail, to: newEmail,
from: {}, from: {},
redirect: `${liliumUrl.url}verifyEmail?isWorker=${!!isWorker}&url=${hederaUrl.url}`, redirect: `${liliumUrl.url}verifyEmail?isWorker=${!!isWorker}`,
template: false, template: false,
mailer: new Mailer, mailer: new Mailer,
host: url[1].split('/')[2], host: url[1].split('/')[2],

View File

@ -2,3 +2,8 @@ INSERT INTO `salix`.`url` (`appName`, `environment`, `url`)
VALUES VALUES
('hedera', 'test', 'https://test-shop.verdnatura.es/'), ('hedera', 'test', 'https://test-shop.verdnatura.es/'),
('hedera', 'production', 'https://shop.verdnatura.es/'); ('hedera', 'production', 'https://shop.verdnatura.es/');
DELETE FROM `salix`.`ACL`
WHERE model = 'Url'
AND 'accessType' = 'READ'
AND principalId = 'employee';