Skip to content
This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Commit 2a1ca4f

Browse files
committed
Hotfix: lowercase email
1 parent 309349a commit 2a1ca4f

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

velog-backend/src/router/auth/auth.ctrl.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ import UserMeta from '../../database/models/UserMeta';
2020

2121
const s3 = new AWS.S3({ region: 'ap-northeast-2', signatureVersion: 'v4' });
2222

23-
2423
export const sendAuthEmail = async (ctx: Context): Promise<*> => {
2524
type BodySchema = {
2625
email: string,
@@ -44,7 +43,8 @@ export const sendAuthEmail = async (ctx: Context): Promise<*> => {
4443
}
4544

4645
try {
47-
const { email }: BodySchema = (ctx.request.body: any);
46+
const { email: rawEmail }: BodySchema = (ctx.request.body: any);
47+
const email = rawEmail.toLowerCase();
4848

4949
// TODO: check email existancy
5050
const user = await User.findUser('email', email);
@@ -280,7 +280,6 @@ export const createLocalAccount = async (ctx: Context): Promise<*> => {
280280
token,
281281
};
282282

283-
284283
setTimeout(() => {
285284
UserMeta.build({
286285
fk_user_id: user.id,

0 commit comments

Comments
 (0)