mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-20 18:25:21 -04:00
fix: rename parseOptionalInt to parseOptionalNumber
This allows us to handle the possible errors due to non-integer numbers with joi and return more precise error messages. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
151e12a8a7
commit
45df0e6edb
7 changed files with 27 additions and 22 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
||||
* SPDX-FileCopyrightText: 2022 The HedgeDoc developers (see AUTHORS file)
|
||||
*
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
@ -9,7 +9,7 @@ import * as Joi from 'joi';
|
|||
import { GitlabScope, GitlabVersion } from './gitlab.enum';
|
||||
import {
|
||||
buildErrorMessage,
|
||||
parseOptionalInt,
|
||||
parseOptionalNumber,
|
||||
replaceAuthErrorsWithEnvironmentVariables,
|
||||
toArrayConfig,
|
||||
} from './utils';
|
||||
|
@ -346,7 +346,7 @@ export default registerAs('authConfig', () => {
|
|||
{
|
||||
session: {
|
||||
secret: process.env.HD_SESSION_SECRET,
|
||||
lifetime: parseOptionalInt(process.env.HD_SESSION_LIFETIME),
|
||||
lifetime: parseOptionalNumber(process.env.HD_SESSION_LIFETIME),
|
||||
},
|
||||
local: {
|
||||
enableLogin: process.env.HD_AUTH_LOCAL_ENABLE_LOGIN,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue