File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change @@ -35,9 +35,7 @@ authRouter.post(
3535 where : { email : body . email }
3636 } )
3737
38- if ( isUserExists ) {
39- return next ( Conflict ( 'Email already exist' ) )
40- }
38+ if ( isUserExists ) return next ( Conflict ( 'Email already exist' ) )
4139
4240 const user = await prisma . user . create ( {
4341 data : {
@@ -65,17 +63,13 @@ authRouter.post(
6563 where : { email : body . email }
6664 } )
6765
68- if ( ! user ) {
69- return next ( Unauthorized ( 'Email or password invalid' ) )
70- }
66+ if ( ! user ) return next ( Unauthorized ( 'Email or password invalid' ) )
7167
7268 const { password, ...userWithoutPassword } = user
7369
7470 const isPasswordMatch = await compare ( body . password , password )
7571
76- if ( ! isPasswordMatch ) {
77- return next ( Unauthorized ( 'Email or password invalid' ) )
78- }
72+ if ( ! isPasswordMatch ) return next ( Unauthorized ( 'Email or password invalid' ) )
7973
8074 const newSession = await prisma . session . create ( {
8175 data : { userId : user . id }
You can’t perform that action at this time.
0 commit comments