diff --git a/api/src/modules/auth/auth.controller.ts b/api/src/modules/auth/auth.controller.ts index 88603f8..5474e81 100644 --- a/api/src/modules/auth/auth.controller.ts +++ b/api/src/modules/auth/auth.controller.ts @@ -17,8 +17,6 @@ export class AuthController { @Get('42/callback') @UseGuards(FortyTwoAuthGuard) async auth42callback(@Req() req: any): Promise<{ token: string; login: string }> { - const logger = new Logger(); - logger.debug(req.user); return { token: await this.authService.login(req.user), login: req.user.login, diff --git a/api/src/modules/auth/auth.dto.ts b/api/src/modules/auth/auth.dto.ts index e4f4654..7a26347 100644 --- a/api/src/modules/auth/auth.dto.ts +++ b/api/src/modules/auth/auth.dto.ts @@ -4,7 +4,7 @@ export class JwtPayload { login: string; } -export class CreateUserDto { +export interface CreateUserDto { //@IsNotEmpty() login: string; diff --git a/api/src/modules/auth/guards/42.guard.ts b/api/src/modules/auth/guards/42.guard.ts index 3514d9b..0c0cd62 100644 --- a/api/src/modules/auth/guards/42.guard.ts +++ b/api/src/modules/auth/guards/42.guard.ts @@ -5,8 +5,6 @@ import { TokenError } from 'passport-oauth2'; @Injectable() export class FortyTwoAuthGuard extends AuthGuard('42') { override handleRequest(err: any, user: any): TUser { - const logger = new Logger(); - logger.debug(`user = ${user}`); if (err || !user) { if (err instanceof TokenError) { throw new UnauthorizedException(err.message); diff --git a/api/src/modules/auth/strategies/42.strategy.ts b/api/src/modules/auth/strategies/42.strategy.ts index e93722b..222a6ab 100644 --- a/api/src/modules/auth/strategies/42.strategy.ts +++ b/api/src/modules/auth/strategies/42.strategy.ts @@ -20,8 +20,6 @@ export class FortyTwoStrategy extends PassportStrategy(Strategy, '42') { } async validate(accessToken: string): Promise { - const logger = new Logger(); - logger.debug(`42 access token = ${accessToken}`); const profile = await this.authService.fetchProfileInformations(accessToken); return profile; } diff --git a/front/src/pages/OauthCallback.tsx b/front/src/pages/OauthCallback.tsx index a5141d9..2c70bed 100644 --- a/front/src/pages/OauthCallback.tsx +++ b/front/src/pages/OauthCallback.tsx @@ -19,6 +19,7 @@ export default function OauthCallback() { } const UseCodeToGetToken = (props: { code: string }) => { + console.log('[UseCodeToGetToken] code =', props.code); const query1 = useApi().get('send oauth code', '/auth/42/callback', { params: { code: props.code }, }) as UseQueryResult;