mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 03:05:19 -04:00
fix: error in replaceAuthErrorsWithEnvironmentVariables
The method should only change error messages if it was called with the correct parameters. Otherwise the function would change e.g `.url` in the error message to `_URL` and the regex is not able to change the front of the error message. Signed-off-by: Philip Molares <philip.molares@udo.edu>
This commit is contained in:
parent
dd1825486c
commit
5db2229771
3 changed files with 94 additions and 61 deletions
|
@ -387,33 +387,38 @@ export default registerAs('authConfig', () => {
|
|||
if (authConfig.error) {
|
||||
const errorMessages = authConfig.error.details
|
||||
.map((detail) => detail.message)
|
||||
.map((error) => {
|
||||
error = replaceAuthErrorsWithEnvironmentVariables(
|
||||
.map((error) =>
|
||||
replaceAuthErrorsWithEnvironmentVariables(
|
||||
error,
|
||||
'gitlab',
|
||||
'HD_AUTH_GITLAB_',
|
||||
gitlabNames,
|
||||
);
|
||||
error = replaceAuthErrorsWithEnvironmentVariables(
|
||||
),
|
||||
)
|
||||
.map((error) =>
|
||||
replaceAuthErrorsWithEnvironmentVariables(
|
||||
error,
|
||||
'ldap',
|
||||
'HD_AUTH_LDAP_',
|
||||
ldapNames,
|
||||
);
|
||||
error = replaceAuthErrorsWithEnvironmentVariables(
|
||||
),
|
||||
)
|
||||
.map((error) =>
|
||||
replaceAuthErrorsWithEnvironmentVariables(
|
||||
error,
|
||||
'saml',
|
||||
'HD_AUTH_SAML_',
|
||||
samlNames,
|
||||
);
|
||||
error = replaceAuthErrorsWithEnvironmentVariables(
|
||||
),
|
||||
)
|
||||
.map((error) =>
|
||||
replaceAuthErrorsWithEnvironmentVariables(
|
||||
error,
|
||||
'oauth2',
|
||||
'HD_AUTH_OAUTH2_',
|
||||
oauth2Names,
|
||||
);
|
||||
return error;
|
||||
});
|
||||
),
|
||||
);
|
||||
throw new Error(buildErrorMessage(errorMessages));
|
||||
}
|
||||
return authConfig.value as AuthConfig;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue