diff --git a/packages/auth-providers/auth0/api/src/decoder.ts b/packages/auth-providers/auth0/api/src/decoder.ts index 1ffb391713e5..b1aa35888066 100644 --- a/packages/auth-providers/auth0/api/src/decoder.ts +++ b/packages/auth-providers/auth0/api/src/decoder.ts @@ -65,7 +65,7 @@ export const verifyAuth0Token = ( }) } -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async (token: string, type: string | null) => { if (type !== 'auth0') { return null } diff --git a/packages/auth-providers/azureActiveDirectory/api/src/decoder.ts b/packages/auth-providers/azureActiveDirectory/api/src/decoder.ts index 447233db4611..e0ea745b5922 100644 --- a/packages/auth-providers/azureActiveDirectory/api/src/decoder.ts +++ b/packages/auth-providers/azureActiveDirectory/api/src/decoder.ts @@ -3,7 +3,7 @@ import jwksClient from 'jwks-rsa' import type { Decoder } from '@redwoodjs/api' -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async (token: string, type: string | null) => { if (type !== 'azureActiveDirectory') { return null } diff --git a/packages/auth-providers/clerk/api/src/decoder.ts b/packages/auth-providers/clerk/api/src/decoder.ts index 28f2c5dab15e..8be5d9a8b5c1 100644 --- a/packages/auth-providers/clerk/api/src/decoder.ts +++ b/packages/auth-providers/clerk/api/src/decoder.ts @@ -3,7 +3,10 @@ import type { Decoder } from '@redwoodjs/api' /** * @deprecated This function will be removed; it uses a rate-limited API. Use `clerkAuthDecoder` instead. */ -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async ( + token: string, + type: string | null +) => { if (type !== 'clerk') { return null } @@ -40,7 +43,7 @@ export const authDecoder: Decoder = async (token: string, type: string) => { export const clerkAuthDecoder: Decoder = async ( token: string, - type: string + type: string | null ) => { if (type !== 'clerk') { return null diff --git a/packages/auth-providers/firebase/api/src/decoder.ts b/packages/auth-providers/firebase/api/src/decoder.ts index 57a0001040c5..7b35a10e261a 100644 --- a/packages/auth-providers/firebase/api/src/decoder.ts +++ b/packages/auth-providers/firebase/api/src/decoder.ts @@ -5,7 +5,7 @@ import type { Decoder } from '@redwoodjs/api' // Alternative third-party JWT verification process described here: // https://firebase.google.com/docs/auth/admin/verify-id-tokens#verify_id_tokens_using_a_third-party_jwt_library -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async (token: string, type: string | null) => { if (type !== 'firebase') { return null } diff --git a/packages/auth-providers/netlify/api/src/decoder.ts b/packages/auth-providers/netlify/api/src/decoder.ts index 58dbf4d21226..67b99f7a78b0 100644 --- a/packages/auth-providers/netlify/api/src/decoder.ts +++ b/packages/auth-providers/netlify/api/src/decoder.ts @@ -17,7 +17,7 @@ interface NetlifyTokenPayload extends Record { export const authDecoder: Decoder = async ( token: string, - type: string, + type: string | null, req: { context: LambdaContext } ) => { if (type !== 'netlify') { diff --git a/packages/auth-providers/supabase/api/src/decoder.ts b/packages/auth-providers/supabase/api/src/decoder.ts index 4c71dca75df4..c29de810aacf 100644 --- a/packages/auth-providers/supabase/api/src/decoder.ts +++ b/packages/auth-providers/supabase/api/src/decoder.ts @@ -2,7 +2,10 @@ import jwt from 'jsonwebtoken' import type { Decoder } from '@redwoodjs/api' -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async ( + token: string, + type: string | null +) => { if (type !== 'supabase') { return null } diff --git a/packages/auth-providers/supertokens/api/src/decoder.ts b/packages/auth-providers/supertokens/api/src/decoder.ts index 400f81b9f7bb..04f39b213468 100644 --- a/packages/auth-providers/supertokens/api/src/decoder.ts +++ b/packages/auth-providers/supertokens/api/src/decoder.ts @@ -4,7 +4,10 @@ import jwksClient from 'jwks-rsa' import type { Decoder } from '@redwoodjs/api' -export const authDecoder: Decoder = async (token: string, type: string) => { +export const authDecoder: Decoder = async ( + token: string, + type: string | null +) => { if (type !== 'supertokens') { return null }