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:
@@ -1,3 +1,4 @@
|
||||
import env from "@server/env";
|
||||
import { User } from "@server/models";
|
||||
|
||||
type Options = {
|
||||
@@ -38,8 +39,7 @@ export default (
|
||||
|
||||
if (options.includeDetails) {
|
||||
userData.email = user.email;
|
||||
userData.language =
|
||||
user.language || process.env.DEFAULT_LANGUAGE || "en_US";
|
||||
userData.language = user.language || env.DEFAULT_LANGUAGE;
|
||||
}
|
||||
|
||||
return userData;
|
||||
|
||||
Reference in New Issue
Block a user