From b9dac2d40ee1b45b4c7342a15e2b89d3bd4d4c28 Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 31 Oct 2024 20:58:40 +0700 Subject: [PATCH 1/2] Expose prompt login option in the public API --- packages/core/src/ILoginInputOptions.ts | 7 +++++++ packages/core/src/login/ILoginOptions.ts | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/packages/core/src/ILoginInputOptions.ts b/packages/core/src/ILoginInputOptions.ts index 91faf78f2f..4f341464c5 100644 --- a/packages/core/src/ILoginInputOptions.ts +++ b/packages/core/src/ILoginInputOptions.ts @@ -55,4 +55,11 @@ export default interface ILoginInputOptions { * secret to authenticate. */ refreshToken?: string; + /** + * Specify whether the Solid Identity Provider may, or may not, interact with the user (for example, + * the normal login process **_requires_** human interaction for them to enter their credentials, + * but if a user simply refreshes the current page in their browser, we'll want to log them in again + * automatically, i.e., without prompting them to manually provide their credentials again). + */ + prompt?: string; } diff --git a/packages/core/src/login/ILoginOptions.ts b/packages/core/src/login/ILoginOptions.ts index 41c0ce5b38..dbae614031 100644 --- a/packages/core/src/login/ILoginOptions.ts +++ b/packages/core/src/login/ILoginOptions.ts @@ -39,13 +39,6 @@ export default interface ILoginOptions extends ILoginInputOptions { // 'bundling' into this options interface), but it wouldn't be a significant // improvement really... sessionId: string; - /** - * Specify whether the Solid Identity Provider may, or may not, interact with the user (for example, - * the normal login process **_requires_** human interaction for them to enter their credentials, - * but if a user simply refreshes the current page in their browser, we'll want to log them in again - * automatically, i.e., without prompting them to manually provide their credentials again). - */ - prompt?: string; // Force the token type to be required (i.e. no longer optional). tokenType: "DPoP" | "Bearer"; From 5f0612f3bb0f291a4f7f2289115f837cadfa357b Mon Sep 17 00:00:00 2001 From: Noel De Martin Date: Thu, 31 Oct 2024 20:59:00 +0700 Subject: [PATCH 2/2] Respect undefined prompt method --- .../oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/browser/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts b/packages/browser/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts index 891adf0923..66851ebc30 100644 --- a/packages/browser/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts +++ b/packages/browser/src/login/oidc/oidcHandlers/AuthorizationCodeWithPkceOidcHandler.ts @@ -62,7 +62,7 @@ export default class AuthorizationCodeWithPkceOidcHandler // profile referenced by the WebId. loadUserInfo: false, code_verifier: true, - prompt: oidcLoginOptions.prompt ?? "consent", + prompt: 'prompt' in oidcLoginOptions ? oidcLoginOptions.prompt : "consent", }; /* eslint-enable camelcase */