Skip to content
This repository was archived by the owner on Oct 10, 2025. It is now read-only.

Commit 1cc7ec5

Browse files
committed
fix: destructure params in _challenge and only send factorId in url params, not body.
1 parent 2ab6825 commit 1cc7ec5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/GoTrueClient.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3156,12 +3156,13 @@ export default class GoTrueClient {
31563156
return { data: null, error: sessionError }
31573157
}
31583158

3159+
const { factorId, ...bodyParams } = params
31593160
const response = (await _request(
31603161
this.fetch,
31613162
'POST',
3162-
`${this.url}/factors/${params.factorId}/challenge`,
3163+
`${this.url}/factors/${factorId}/challenge`,
31633164
{
3164-
body: params,
3165+
body: bodyParams,
31653166
headers: this.headers,
31663167
jwt: sessionData?.session?.access_token,
31673168
}

0 commit comments

Comments
 (0)