feat(core)!: Set the secure flag on issued cookies (#8812)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-03-05 18:57:41 +01:00
committed by GitHub
parent 2b0e14e936
commit 0818824a72
6 changed files with 44 additions and 12 deletions

View File

@@ -82,6 +82,7 @@ export class AuthService {
maxAge: this.jwtExpiration * Time.seconds.toMilliseconds,
httpOnly: true,
sameSite: 'lax',
secure: config.getEnv('secure_cookie'),
});
}

View File

@@ -15,6 +15,7 @@ if (inE2ETests) {
process.env.N8N_LOG_LEVEL = 'silent';
process.env.N8N_PUBLIC_API_DISABLED = 'true';
process.env.SKIP_STATISTICS_EVENTS = 'true';
process.env.N8N_SECURE_COOKIE = 'false';
} else {
dotenv.config();
}

View File

@@ -538,6 +538,12 @@ export const schema = {
env: 'N8N_PROTOCOL',
doc: 'HTTP Protocol via which n8n can be reached',
},
secure_cookie: {
doc: 'This sets the `Secure` flag on n8n auth cookie',
format: Boolean,
default: true,
env: 'N8N_SECURE_COOKIE',
},
ssl_key: {
format: String,
default: '',