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:
@@ -3,6 +3,7 @@ import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Query,
|
||||
Req,
|
||||
Request,
|
||||
Res,
|
||||
@@ -34,9 +35,13 @@ export class AuthController {
|
||||
** Route to initiate magic-link auth for a users email
|
||||
*/
|
||||
@Post('signin')
|
||||
async signInMagicLink(@Body() authData: SignInMagicDto) {
|
||||
async signInMagicLink(
|
||||
@Body() authData: SignInMagicDto,
|
||||
@Query('origin') origin: string,
|
||||
) {
|
||||
const deviceIdToken = await this.authService.signInMagicLink(
|
||||
authData.email,
|
||||
origin,
|
||||
);
|
||||
if (E.isLeft(deviceIdToken)) throwHTTPErr(deviceIdToken.left);
|
||||
return deviceIdToken.right;
|
||||
|
||||
Reference in New Issue
Block a user