hotfix: magiclink dynamic email redirection url (#67)

* chore: modified magiclink /signin function to work with origin

* chore: modified testcases for signInMagicLink to reflect new changes

* chore: removed prisma migration file

* chore: removed admin module dulicate from guards folder

* chore: implemented ENUMs for origins in signin method

* chore: added VITE_ADMIN_URL to .env.example file
This commit is contained in:
Balu Babu
2023-04-06 11:41:01 +05:30
committed by GitHub
parent 6d688ed2bc
commit 22aa8ee334
5 changed files with 32 additions and 4 deletions

View File

@@ -77,7 +77,7 @@ const encodedRefreshToken =
describe('signInMagicLink', () => {
test('Should throw error if email is not in valid format', async () => {
const result = await authService.signInMagicLink('bbbgmail.com');
const result = await authService.signInMagicLink('bbbgmail.com', 'admin');
expect(result).toEqualLeft({
message: INVALID_EMAIL,
statusCode: HttpStatus.BAD_REQUEST,
@@ -94,6 +94,7 @@ describe('signInMagicLink', () => {
const result = await authService.signInMagicLink(
'dwight@dundermifflin.com',
'admin',
);
expect(result).toEqualRight({
deviceIdentifier: passwordlessData.deviceIdentifier,
@@ -108,6 +109,7 @@ describe('signInMagicLink', () => {
const result = await authService.signInMagicLink(
'dwight@dundermifflin.com',
'admin',
);
expect(result).toEqualRight({
deviceIdentifier: passwordlessData.deviceIdentifier,