mirror of
https://github.com/plankanban/planka.git
synced 2025-07-22 22:59:44 +02:00
feat: Automatic logout when session expires
Some checks are pending
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm/v7) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm64) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted x64], linux/amd64) (push) Waiting to run
Build and push Docker DEV image / merge (push) Blocked by required conditions
Build and push Docker DEV image / rerun-failed-jobs (push) Blocked by required conditions
Some checks are pending
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm/v7) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted arm64], linux/arm64) (push) Waiting to run
Build and push Docker DEV image / build ([self-hosted x64], linux/amd64) (push) Waiting to run
Build and push Docker DEV image / merge (push) Blocked by required conditions
Build and push Docker DEV image / rerun-failed-jobs (push) Blocked by required conditions
Closes #693
This commit is contained in:
parent
b46fb43e6f
commit
4e2863faa7
15 changed files with 130 additions and 42 deletions
|
@ -1,6 +1,14 @@
|
|||
const nodemailer = require('nodemailer');
|
||||
|
||||
module.exports = function smtpServiceHook(sails) {
|
||||
/**
|
||||
* smtp hook
|
||||
*
|
||||
* @description :: A hook definition. Extends Sails by adding shadow routes, implicit actions,
|
||||
* and/or initialization logic.
|
||||
* @docs :: https://sailsjs.com/docs/concepts/extending-sails/hooks
|
||||
*/
|
||||
|
||||
module.exports = function defineSmtpHook(sails) {
|
||||
let transporter = null;
|
||||
|
||||
return {
|
||||
|
@ -9,19 +17,22 @@ module.exports = function smtpServiceHook(sails) {
|
|||
*/
|
||||
|
||||
async initialize() {
|
||||
if (sails.config.custom.smtpHost) {
|
||||
transporter = nodemailer.createTransport({
|
||||
pool: true,
|
||||
host: sails.config.custom.smtpHost,
|
||||
port: sails.config.custom.smtpPort,
|
||||
secure: sails.config.custom.smtpSecure,
|
||||
auth: sails.config.custom.smtpUser && {
|
||||
user: sails.config.custom.smtpUser,
|
||||
pass: sails.config.custom.smtpPassword,
|
||||
},
|
||||
});
|
||||
sails.log.info('SMTP hook has been loaded successfully');
|
||||
if (!sails.config.custom.smtpHost) {
|
||||
return;
|
||||
}
|
||||
|
||||
sails.log.info('Initializing custom hook (`smtp`)');
|
||||
|
||||
transporter = nodemailer.createTransport({
|
||||
pool: true,
|
||||
host: sails.config.custom.smtpHost,
|
||||
port: sails.config.custom.smtpPort,
|
||||
secure: sails.config.custom.smtpSecure,
|
||||
auth: sails.config.custom.smtpUser && {
|
||||
user: sails.config.custom.smtpUser,
|
||||
pass: sails.config.custom.smtpPassword,
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
getTransporter() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue