fix(api): 🐛 Correctly decode URI component when obtaining token.

Prevents redirect_uri mismatch by normalizing URL encoding
This commit is contained in:
Jesse Wierzbinski 2024-09-04 23:11:16 +02:00
parent 9dc143060f
commit 7f8ade5fc1
No known key found for this signature in database

View file

@ -112,7 +112,10 @@ export default apiRoute((app) =>
where: (token, { eq, and }) =>
and(
eq(token.code, code),
eq(token.redirectUri, redirect_uri),
eq(
token.redirectUri,
decodeURIComponent(redirect_uri),
),
eq(token.clientId, client_id),
),
});