Skip to content

Commit e5cd03b

Browse files
committed
fix(auth): remove trailing slash from audience check to match Auth0 tokens
1 parent 917c80e commit e5cd03b

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/app/api/mobile/logout/route.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ async function verifyAccessToken (request: NextRequest): Promise<boolean> {
2121
try {
2222
await jwtVerify(token, JWKS, {
2323
issuer: issuer + '/',
24-
audience: 'https://api.openbeta.io/'
24+
audience: 'https://api.openbeta.io'
2525
})
2626
return true
2727
} catch {

src/js/auth/withUserAuth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ export const withUserAuth = (handler: Next13APIHandler): Next13APIHandler => {
4141
const { payload } = await jwtVerify(token, JWKS, {
4242
issuer: issuer + '/',
4343
audience: [
44-
'https://api.openbeta.io/', // Access token (web)
45-
clientId // ID token (mobile client ID)
44+
'https://api.openbeta.io', // Access token (no trailing slash)
45+
clientId // ID token
4646
]
4747
})
4848

0 commit comments

Comments
 (0)