settings: move cookie secret into oidc

This commit is contained in:
Girish Ramakrishnan
2023-08-02 20:01:29 +05:30
parent 77e6b69a63
commit e1fd369c6d
2 changed files with 3 additions and 19 deletions
+1 -17
View File
@@ -7,9 +7,6 @@ exports = module.exports = {
getTimeZone,
setTimeZone,
getCookieSecret,
setCookieSecret,
getCloudronName,
setCloudronName,
@@ -116,7 +113,7 @@ exports = module.exports = {
// strings
AUTOUPDATE_PATTERN_KEY: 'autoupdate_pattern',
TIME_ZONE_KEY: 'time_zone',
CLOUDRON_COOKIE_SECRET_KEY: 'cookie_secret',
OIDC_COOKIE_SECRET_KEY: 'cookie_secret',
CLOUDRON_NAME_KEY: 'cloudron_name',
LANGUAGE_KEY: 'language',
CLOUDRON_ID_KEY: 'cloudron_id',
@@ -324,19 +321,6 @@ async function getTimeZone() {
return tz;
}
async function getCookieSecret() {
const secret = await get(exports.CLOUDRON_COOKIE_SECRET_KEY);
return secret;
}
async function setCookieSecret(secret) {
assert.strictEqual(typeof secret, 'string');
if (!secret) throw new BoxError(BoxError.BAD_FIELD, 'secret is empty');
await set(exports.CLOUDRON_COOKIE_SECRET_KEY, secret);
}
async function getCloudronName() {
const name = await get(exports.CLOUDRON_NAME_KEY);
if (name === null) return gDefaults[exports.CLOUDRON_NAME_KEY];