Skip to content

Commit

Permalink
Hotfix: lowercase email
Browse files Browse the repository at this point in the history
  • Loading branch information
velopert committed Oct 26, 2019
1 parent 309349a commit 2a1ca4f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions velog-backend/src/router/auth/auth.ctrl.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import UserMeta from '../../database/models/UserMeta';

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


export const sendAuthEmail = async (ctx: Context): Promise<*> => {
type BodySchema = {
email: string,
Expand All @@ -44,7 +43,8 @@ export const sendAuthEmail = async (ctx: Context): Promise<*> => {
}

try {
const { email }: BodySchema = (ctx.request.body: any);
const { email: rawEmail }: BodySchema = (ctx.request.body: any);
const email = rawEmail.toLowerCase();

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


setTimeout(() => {
UserMeta.build({
fk_user_id: user.id,
Expand Down

0 comments on commit 2a1ca4f

Please sign in to comment.