Skip to content

Commit

Permalink
Undo decoder type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dac09 committed Dec 22, 2023
1 parent 0979725 commit 1a3cbd4
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 17 deletions.
2 changes: 1 addition & 1 deletion packages/auth-providers/auth0/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const verifyAuth0Token = (
})
}

export const authDecoder: Decoder = async (token: string, type: string | null) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'auth0') {
return null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import jwksClient from 'jwks-rsa'

import type { Decoder } from '@redwoodjs/api'

export const authDecoder: Decoder = async (token: string, type: string | null) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'azureActiveDirectory') {
return null
}
Expand Down
7 changes: 2 additions & 5 deletions packages/auth-providers/clerk/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ 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 | null
) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'clerk') {
return null
}
Expand Down Expand Up @@ -43,7 +40,7 @@ export const authDecoder: Decoder = async (

export const clerkAuthDecoder: Decoder = async (
token: string,
type: string | null
type: string
) => {
if (type !== 'clerk') {
return null
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/firebase/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 | null) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'firebase') {
return null
}
Expand Down
2 changes: 1 addition & 1 deletion packages/auth-providers/netlify/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ interface NetlifyTokenPayload extends Record<string, unknown> {

export const authDecoder: Decoder = async (
token: string,
type: string | null,
type: string,
req: { context: LambdaContext }
) => {
if (type !== 'netlify') {
Expand Down
5 changes: 1 addition & 4 deletions packages/auth-providers/supabase/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ import jwt from 'jsonwebtoken'

import type { Decoder } from '@redwoodjs/api'

export const authDecoder: Decoder = async (
token: string,
type: string | null
) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'supabase') {
return null
}
Expand Down
5 changes: 1 addition & 4 deletions packages/auth-providers/supertokens/api/src/decoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,7 @@ import jwksClient from 'jwks-rsa'

import type { Decoder } from '@redwoodjs/api'

export const authDecoder: Decoder = async (
token: string,
type: string | null
) => {
export const authDecoder: Decoder = async (token: string, type: string) => {
if (type !== 'supertokens') {
return null
}
Expand Down

0 comments on commit 1a3cbd4

Please sign in to comment.