From a82c634acfffb08b1d6b3d4c4dc41b99b0fd16d6 Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Thu, 12 Sep 2024 09:44:20 +0100 Subject: [PATCH 1/2] fix: offline scope --- lib/types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/types.ts b/lib/types.ts index 8904ff0..9d46ae7 100644 --- a/lib/types.ts +++ b/lib/types.ts @@ -2,7 +2,7 @@ export enum Scopes { email = "email", profile = "profile", openid = "openid", - offline_access = "offline_access", + offline_access = "offline", } export type LoginMethodParams = Pick< From 9be8fce3ce0f926909afbbd75cfc99709aa3392e Mon Sep 17 00:00:00 2001 From: Daniel Rivers Date: Thu, 12 Sep 2024 09:57:39 +0100 Subject: [PATCH 2/2] fix: tests --- lib/utils/generateAuthUrl.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/utils/generateAuthUrl.test.ts b/lib/utils/generateAuthUrl.test.ts index f18e8da..b7de1f4 100644 --- a/lib/utils/generateAuthUrl.test.ts +++ b/lib/utils/generateAuthUrl.test.ts @@ -61,7 +61,7 @@ describe("generateAuthUrl", () => { state: "state123", }; const expectedUrl = - "https://auth.example.com/oauth2/auth?client_id=client123&response_type=code&start_page=login&redirect_uri=https%3A%2F%2Fexample2.com&scope=openid+profile+offline_access&prompt=create&state=state123"; + "https://auth.example.com/oauth2/auth?client_id=client123&response_type=code&start_page=login&redirect_uri=https%3A%2F%2Fexample2.com&scope=openid+profile+offline&prompt=create&state=state123"; const result = generateAuthUrl(domain, IssuerRouteTypes.login, options); const nonce = result.url.searchParams.get("nonce"); @@ -80,7 +80,7 @@ describe("generateAuthUrl", () => { prompt: "create", }; const expectedUrl = - "https://auth.example.com/oauth2/auth?client_id=client123&response_type=code&start_page=login&redirect_uri=https%3A%2F%2Fexample2.com&scope=openid+profile+offline_access&prompt=create"; + "https://auth.example.com/oauth2/auth?client_id=client123&response_type=code&start_page=login&redirect_uri=https%3A%2F%2Fexample2.com&scope=openid+profile+offline&prompt=create"; const result = generateAuthUrl(domain, IssuerRouteTypes.login, options); const nonce = result.url.searchParams.get("nonce");