This commit is contained in:
syuilo
2021-12-09 23:58:30 +09:00
parent 0abe2dfee0
commit c69b72e199
573 changed files with 3318 additions and 3318 deletions

View File

@@ -17,16 +17,16 @@ export const meta = {
limit: {
duration: ms('1hour'),
max: 3
max: 3,
},
params: {
password: {
validator: $.str
validator: $.str,
},
email: {
validator: $.optional.nullable.str
validator: $.optional.nullable.str,
},
},
@@ -34,15 +34,15 @@ export const meta = {
incorrectPassword: {
message: 'Incorrect password.',
code: 'INCORRECT_PASSWORD',
id: 'e54c1d7e-e7d6-4103-86b6-0a95069b4ad3'
id: 'e54c1d7e-e7d6-4103-86b6-0a95069b4ad3',
},
unavailable: {
message: 'Unavailable email address.',
code: 'UNAVAILABLE',
id: 'a2defefb-f220-8849-0af6-17f816099323'
id: 'a2defefb-f220-8849-0af6-17f816099323',
},
}
},
};
export default define(meta, async (ps, user) => {
@@ -65,12 +65,12 @@ export default define(meta, async (ps, user) => {
await UserProfiles.update(user.id, {
email: ps.email,
emailVerified: false,
emailVerifyCode: null
emailVerifyCode: null,
});
const iObj = await Users.pack(user.id, user, {
detail: true,
includeSecrets: true
includeSecrets: true,
});
// Publish meUpdated event
@@ -80,7 +80,7 @@ export default define(meta, async (ps, user) => {
const code = rndstr('a-z0-9', 16);
await UserProfiles.update(user.id, {
emailVerifyCode: code
emailVerifyCode: code,
});
const link = `${config.url}/verify-email/${code}`;