mirror of
https://github.com/better-auth/better-auth.git
synced 2026-05-23 23:52:05 -05:00
test(oauth-provider): update remaining consent response assertions from uri to url
This commit is contained in:
@@ -978,18 +978,18 @@ describe("oauth - prompt", async () => {
|
||||
);
|
||||
|
||||
expect(consentRes.redirect).toBeTruthy();
|
||||
expect(consentRes.uri).toContain(redirectUri);
|
||||
expect(consentRes.uri).toContain(`code=`);
|
||||
expect(consentRes.uri).not.toContain(`/consent`);
|
||||
expect(consentRes.url).toContain(redirectUri);
|
||||
expect(consentRes.url).toContain(`code=`);
|
||||
expect(consentRes.url).not.toContain(`/consent`);
|
||||
|
||||
// Exchange code for tokens and verify narrowed scopes
|
||||
const callbackUrl = new URL(consentRes.uri);
|
||||
const callbackUrl = new URL(consentRes.url);
|
||||
const code = callbackUrl.searchParams.get("code")!;
|
||||
expect(code).toBeTruthy();
|
||||
|
||||
// Follow the RP callback to exchange the code for tokens
|
||||
let authToken: string | undefined;
|
||||
await client.$fetch(consentRes.uri, {
|
||||
await client.$fetch(consentRes.url, {
|
||||
method: "GET",
|
||||
headers: oauthHeaders,
|
||||
onError(context) {
|
||||
|
||||
Reference in New Issue
Block a user