From aa5d7307b60a39369f214fa43a7c33dae82a5d57 Mon Sep 17 00:00:00 2001 From: Valentin Laurin Date: Thu, 6 Mar 2025 17:09:53 +0000 Subject: [PATCH] Breaking: Rename config `loginHint.enable` For consistency with other `enabled` flags, this config property should be `enabled` --- src/openid/not-authenticated.js | 2 +- src/openid/not-authenticated.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/openid/not-authenticated.js b/src/openid/not-authenticated.js index 7aac6a0..6c4e4f3 100644 --- a/src/openid/not-authenticated.js +++ b/src/openid/not-authenticated.js @@ -34,7 +34,7 @@ export const startAuth302 = (deps) => (config) => (auth = {}) => (req, res) => { const authorizationUrl = authorizationUrlSupplier({ id_token_hint: req.session?.openId?.tokenSet?.id_token, - login_hint: loginHint?.enable ? req.session.openId?.claims?.[loginHint.claim] : undefined, + login_hint: loginHint?.enabled ? req.session.openId?.claims?.[loginHint.claim] : undefined, max_age: maxAge ?? undefined, nonce, prompt: promptSupplier(auth), diff --git a/src/openid/not-authenticated.test.js b/src/openid/not-authenticated.test.js index 29696c4..3c22a23 100644 --- a/src/openid/not-authenticated.test.js +++ b/src/openid/not-authenticated.test.js @@ -160,7 +160,7 @@ describe('startAuth302', () => { const config = { ...options, loginHint: { - enable: true, + enabled: true, claim: 'something', } }; @@ -182,7 +182,7 @@ describe('startAuth302', () => { const config = { ...options, loginHint: { - enable: true, + enabled: true, claim: 'other', } }; @@ -204,7 +204,7 @@ describe('startAuth302', () => { const config = { ...options, loginHint: { - enable: false, + enabled: false, claim: 'email', } };