From ee8e0e26db1e2edc2d865fb7aaac81c2a97f575a Mon Sep 17 00:00:00 2001 From: Zoe Roux Date: Tue, 19 Sep 2023 19:30:55 +0200 Subject: [PATCH] Fix eslint and bad reverify mail issue --- back/src/auth/auth.controller.ts | 4 +++- front/components/Metronome.tsx | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/back/src/auth/auth.controller.ts b/back/src/auth/auth.controller.ts index b63d71c..f31b9f7 100644 --- a/back/src/auth/auth.controller.ts +++ b/back/src/auth/auth.controller.ts @@ -97,7 +97,9 @@ export class AuthController { @UseGuards(JwtAuthGuard) @Put('reverify') async reverify(@Request() req: any): Promise { - await this.authService.sendVerifyMail(req.user); + const user = await this.usersService.user({ id: req.user.id }); + if (!user) throw new BadRequestException("Invalid user"); + await this.authService.sendVerifyMail(user); } @ApiBody({ type: LoginDto }) diff --git a/front/components/Metronome.tsx b/front/components/Metronome.tsx index 9013cd9..320770a 100644 --- a/front/components/Metronome.tsx +++ b/front/components/Metronome.tsx @@ -1,4 +1,4 @@ -import { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef } from 'react'; import { Slider, Switch, Text, View } from 'native-base'; export const Metronome = ({ paused = false, bpm }: { paused?: boolean; bpm: number }) => {