chore: Centralize env parsing, validation, defaults, and deprecation notices (#3487)
* chore: Centralize env parsing, defaults, deprecation * wip * test * test * tsc * docs, more validation * fix: Allow empty REDIS_URL (defaults to localhost) * test * fix: SLACK_MESSAGE_ACTIONS not bool * fix: Add SMTP port validation
This commit is contained in:
@@ -3,8 +3,7 @@ import env from "./env";
|
||||
|
||||
export function AuthenticationError(
|
||||
message = "Invalid authentication",
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string | undefined' is not assignable to typ... Remove this comment to see the full error message
|
||||
redirectUrl: string = env.URL
|
||||
redirectUrl = env.URL
|
||||
) {
|
||||
return httpErrors(401, message, {
|
||||
redirectUrl,
|
||||
@@ -113,8 +112,7 @@ export function MaximumTeamsError(
|
||||
|
||||
export function EmailAuthenticationRequiredError(
|
||||
message = "User must authenticate with email",
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string | undefined' is not assignable to typ... Remove this comment to see the full error message
|
||||
redirectUrl: string = env.URL
|
||||
redirectUrl = env.URL
|
||||
) {
|
||||
return httpErrors(400, message, {
|
||||
redirectUrl,
|
||||
@@ -148,8 +146,7 @@ export function OIDCMalformedUserInfoError(
|
||||
|
||||
export function AuthenticationProviderDisabledError(
|
||||
message = "Authentication method has been disabled by an admin",
|
||||
// @ts-expect-error ts-migrate(2322) FIXME: Type 'string | undefined' is not assignable to typ... Remove this comment to see the full error message
|
||||
redirectUrl: string = env.URL
|
||||
redirectUrl = env.URL
|
||||
) {
|
||||
return httpErrors(400, message, {
|
||||
redirectUrl,
|
||||
|
||||
Reference in New Issue
Block a user