From b55e4731d3005ffb8c7671a94273ddb38d543392 Mon Sep 17 00:00:00 2001 From: Helio Chissini de Castro Date: Sun, 17 Nov 2024 21:45:28 +0100 Subject: [PATCH] chore: Small lint fixes Signed-off-by: Helio Chissini de Castro --- src/app/[locale]/requests/page.tsx | 2 +- .../sw360OauthPwdGrantTypeOption.ts | 2 +- src/app/api/session/route.ts | 5 ++-- src/services/auth.service.ts | 27 ++++++++++--------- src/services/message.service.ts | 6 ++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/app/[locale]/requests/page.tsx b/src/app/[locale]/requests/page.tsx index 517e53195..c7a2c560c 100644 --- a/src/app/[locale]/requests/page.tsx +++ b/src/app/[locale]/requests/page.tsx @@ -15,7 +15,7 @@ export const metadata: Metadata = { title: 'Requests', } -async function RequestsPage() { +function RequestsPage(): JSX.Element { return } diff --git a/src/app/api/auth/[...nextauth]/sw360OauthPwdGrantTypeOption.ts b/src/app/api/auth/[...nextauth]/sw360OauthPwdGrantTypeOption.ts index 426347b2b..8435c8790 100644 --- a/src/app/api/auth/[...nextauth]/sw360OauthPwdGrantTypeOption.ts +++ b/src/app/api/auth/[...nextauth]/sw360OauthPwdGrantTypeOption.ts @@ -68,4 +68,4 @@ const sw360OauthPwdGrantTypeOption: NextAuthOptions = { }, } -export default sw360OauthPwdGrantTypeOption \ No newline at end of file +export default sw360OauthPwdGrantTypeOption diff --git a/src/app/api/session/route.ts b/src/app/api/session/route.ts index 970bbfa98..7b64bba51 100644 --- a/src/app/api/session/route.ts +++ b/src/app/api/session/route.ts @@ -12,7 +12,7 @@ import { getServerSession } from 'next-auth' import { NextResponse } from 'next/server' import authOptions from '../auth/[...nextauth]/authOptions' -export async function GET() { +export async function GET(): Promise { const session = await getServerSession(authOptions) if (!session) { @@ -20,8 +20,7 @@ export async function GET() { } return NextResponse.json({ - authenticated: !!session, + authenticated: true, session, }) } -1 diff --git a/src/services/auth.service.ts b/src/services/auth.service.ts index f7df868b8..14057fcc0 100644 --- a/src/services/auth.service.ts +++ b/src/services/auth.service.ts @@ -15,26 +15,26 @@ const generateToken = async (userData: UserCredentialInfo): Promise + const oauth_clients = (await response.json()) as Array oAuthClient = oauth_clients[0] } - + if (oAuthClient == null) { return null } - + credentials = Buffer.from(`${oAuthClient.client_id}:${oAuthClient.client_secret}`, `binary`).toString('base64') - + opts.headers['Authorization'] = `Basic ${credentials}` const authorizationURL: string = SW360_API_URL + @@ -42,14 +42,15 @@ const generateToken = async (userData: UserCredentialInfo): Promise