Implement email config

This commit is contained in:
syuilo 2018-11-29 16:23:45 +09:00
parent 0ce64f8c33
commit 1bc109b42c
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
10 changed files with 280 additions and 13 deletions

View file

@ -78,6 +78,8 @@ export interface ILocalUser extends IUserBase {
host: null;
keypair: string;
email: string;
emailVerified?: boolean;
emailVerifyCode?: string;
password: string;
token: string;
twitter: {
@ -99,9 +101,6 @@ export interface ILocalUser extends IUserBase {
username: string;
discriminator: string;
};
line: {
userId: string;
};
profile: {
location: string;
birthday: string; // 'YYYY-MM-DD'
@ -286,6 +285,7 @@ export const pack = (
delete _user._id;
delete _user.usernameLower;
delete _user.emailVerifyCode;
if (_user.host == null) {
// Remove private properties
@ -306,11 +306,11 @@ export const pack = (
delete _user.discord.refreshToken;
delete _user.discord.expiresDate;
}
delete _user.line;
// Visible via only the official client
if (!opts.includeSecrets) {
delete _user.email;
delete _user.emailVerified;
delete _user.settings;
delete _user.clientSettings;
}