-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(auth): Updated authentication logic
- Loading branch information
Showing
5 changed files
with
56 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,28 +41,7 @@ describe('Auth Controller Tests', () => { | |
it('should be able to sign up using email', async () => { | ||
const response = await app.inject({ | ||
method: 'POST', | ||
url: '/auth/sign-up', | ||
payload: { | ||
email: '[email protected]', | ||
}, | ||
}); | ||
|
||
expect(response.statusCode).toEqual(201); | ||
expect(response.json().email).toEqual('[email protected]'); | ||
}); | ||
|
||
it('should be able to sign in using email', async () => { | ||
await prisma.user.create({ | ||
data: { | ||
email: '[email protected]', | ||
isEmailVerified: true, | ||
authType: AuthType.EMAIL, | ||
}, | ||
}); | ||
|
||
const response = await app.inject({ | ||
method: 'POST', | ||
url: '/auth/sign-in', | ||
url: '/auth/send-verification-email', | ||
payload: { | ||
email: '[email protected]', | ||
}, | ||
|
@@ -75,10 +54,9 @@ describe('Auth Controller Tests', () => { | |
it('should send verification code to email on sign up', async () => { | ||
await app.inject({ | ||
method: 'POST', | ||
url: '/auth/sign-up', | ||
url: '/auth/send-verification-email', | ||
payload: { | ||
email: '[email protected]', | ||
password: 'Password123', | ||
}, | ||
}); | ||
|
||
|
@@ -123,10 +101,9 @@ describe('Auth Controller Tests', () => { | |
// Sign up | ||
await app.inject({ | ||
method: 'POST', | ||
url: '/auth/sign-up', | ||
url: '/auth/send-verification-email', | ||
payload: { | ||
email: '[email protected]', | ||
password: 'Password123', | ||
}, | ||
}); | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters