diff --git a/packages/hoppscotch-backend/src/auth/auth.controller.ts b/packages/hoppscotch-backend/src/auth/auth.controller.ts index 1f7fd35b5..32cec7878 100644 --- a/packages/hoppscotch-backend/src/auth/auth.controller.ts +++ b/packages/hoppscotch-backend/src/auth/auth.controller.ts @@ -5,10 +5,8 @@ import { InternalServerErrorException, Post, Query, - Req, Request, Res, - UnauthorizedException, UseGuards, } from '@nestjs/common'; import { AuthService } from './auth.service'; diff --git a/packages/hoppscotch-backend/src/auth/helper.ts b/packages/hoppscotch-backend/src/auth/helper.ts index 5b4c08839..b3e7cbdea 100644 --- a/packages/hoppscotch-backend/src/auth/helper.ts +++ b/packages/hoppscotch-backend/src/auth/helper.ts @@ -1,10 +1,11 @@ -import { ForbiddenException, HttpException, HttpStatus } from '@nestjs/common'; +import { HttpException, HttpStatus } from '@nestjs/common'; import { DateTime } from 'luxon'; import { AuthError } from 'src/types/AuthError'; import { AuthTokens } from 'src/types/AuthTokens'; import { Response } from 'express'; import * as cookie from 'cookie'; import { AUTH_PROVIDER_NOT_SPECIFIED, COOKIES_NOT_FOUND } from 'src/errors'; +import { throwErr } from 'src/utils'; enum AuthTokenType { ACCESS_TOKEN = 'access_token', @@ -106,7 +107,7 @@ export const subscriptionContextCookieParser = (rawCookies: string) => { */ export function authProviderCheck(provider: string) { if (!provider) { - throw new Error(AUTH_PROVIDER_NOT_SPECIFIED); + throwErr(AUTH_PROVIDER_NOT_SPECIFIED); } const envVariables = process.env.ALLOWED_AUTH_PROVIDERS.split(',').map(