Skip to content

Commit

Permalink
replace hard coded secret with uuid
Browse files Browse the repository at this point in the history
Signed-off-by: Steve Cassidy <steve.cassidy@mq.edu.au>
  • Loading branch information
stevecassidy committed May 20, 2024
1 parent eb56b4b commit 00817ca
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/buildconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
* which server to use and whether to include test data
*/

import {v4 as uuidv4} from 'uuid';
import nodemailer from 'nodemailer';

const TRUTHY_STRINGS = ['true', '1', 'on', 'yes'];
Expand Down Expand Up @@ -183,8 +184,8 @@ function instance_name(): string {
function cookie_secret(): string {
const cookie = process.env.FAIMS_COOKIE_SECRET;
if (cookie === '' || cookie === undefined) {
console.log('FAIMS_COOKIE_SECRET not set, using default');
return 'ahquoo4ohfaGh1oozoinai9ulah8ouge';
console.log('FAIMS_COOKIE_SECRET not set, using generated secret');
return uuidv4();
} else {
return cookie;
}
Expand Down

0 comments on commit 00817ca

Please sign in to comment.