Skip to content

Commit

Permalink
feat(configuration): fixed cookies configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
xutyxd committed Sep 29, 2024
1 parent a8731c3 commit 326b9fd
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
10 changes: 5 additions & 5 deletions fixup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ cat >server/cjs/package.json <<!EOF
}
!EOF

cat >server/mjs/package.json <<!EOF
{
"type": "module"
}
!EOF
# cat >server/mjs/package.json <<!EOF
# {
# "type": "module"
# }
# !EOF
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"openapi:types": "openapi-typescript src/openapi/specification.json -o src/openapi/specification.d.ts",
"server:build:commonjs": "rm -fr server/cjs/* && tsc -p tsconfig-server-cjs.json && bash cjs-formatter.sh",
"server:build:mjs": "rm -fr server/mjs/* && tsc -p tsconfig-server-mjs.json && bash mjs-formatter.sh",
"server:build": "npm run server:build:commonjs && npm run server:build:mjs && ./fixup.sh",
"server:build": "npm run server:build:commonjs && ./fixup.sh",
"package:build": "",
"start": "npm run server:build && node ./server/cjs/index.js",
"clean": "npm prune --production",
Expand Down
16 changes: 15 additions & 1 deletion src/server/configuration/services/configuration.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,21 @@ export class ConfigurationService {

public keys = {
cookies: () => {
return structuredClone(this.KEYS.cookies || []);
const keys = (this.KEYS.cookies || []) as string[];

if (!keys.length) {
[
"This is a test key",
"This is another test key",
"This is yet another test key"
].forEach((key) => {
keys.push(key);
});

console.warn('No keys found, using default ones!');
}

return structuredClone(keys);
},
oauth: () => {
return structuredClone(this.KEYS.oauth || { });
Expand Down

0 comments on commit 326b9fd

Please sign in to comment.