Skip to content

Commit

Permalink
fix: typo in consent detail missingOIDClaims -> missingOIDCClaims
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Mar 10, 2021
1 parent 6cab64e commit 1427383
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2500,12 +2500,12 @@ new Prompt(
}

if (missing && missing.length) {
ctx.oidc[missingOIDClaims] = missing;
ctx.oidc[missingOIDCClaims] = missing;
return Check.REQUEST_PROMPT;
}

return Check.NO_NEED_TO_PROMPT;
}, ({ oidc }) => ({ missingOIDClaims: oidc[missingOIDClaims] })),
}, ({ oidc }) => ({ missingOIDCClaims: oidc[missingOIDCClaims] })),

// checks resource server scopes
new Check('rs_scopes_missing', 'requested scopes not granted', (ctx) => {
Expand Down
4 changes: 2 additions & 2 deletions example/routes/express.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ module.exports = (app, provider) => {
if (details.missingOIDCScope) {
grant.addOIDCScope(details.missingOIDCScope.join(' '));
}
if (details.missingOIDClaims) {
grant.addOIDCClaims(details.missingOIDClaims);
if (details.missingOIDCClaims) {
grant.addOIDCClaims(details.missingOIDCClaims);
}
if (details.missingResourceScopes) {
// eslint-disable-next-line no-restricted-syntax
Expand Down
4 changes: 2 additions & 2 deletions example/routes/koa.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,8 @@ module.exports = (provider) => {
if (details.missingOIDCScope) {
grant.addOIDCScope(details.missingOIDCScope.join(' '));
}
if (details.missingOIDClaims) {
grant.addOIDCClaims(details.missingOIDClaims);
if (details.missingOIDCClaims) {
grant.addOIDCClaims(details.missingOIDCClaims);
}
if (details.missingResourceScopes) {
// eslint-disable-next-line no-restricted-syntax
Expand Down
8 changes: 4 additions & 4 deletions example/views/interaction.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</div>

<ul>
<% if ([details.missingOIDCScope, details.missingOIDClaims, details.missingResourceScopes].filter(Boolean).length === 0) { %>
<% if ([details.missingOIDCScope, details.missingOIDCClaims, details.missingResourceScopes].filter(Boolean).length === 0) { %>
<li>the client is asking you to confirm previously given authorization</li>
<% } %>

Expand All @@ -17,11 +17,11 @@
</ul>
<% } %>

<% missingOIDClaims = new Set(details.missingOIDClaims); ['sub', 'sid', 'auth_time', 'acr', 'amr', 'iss'].forEach(Set.prototype.delete.bind(missingOIDClaims)) %>
<% if (missingOIDClaims.size) { %>
<% missingOIDCClaims = new Set(details.missingOIDCClaims); ['sub', 'sid', 'auth_time', 'acr', 'amr', 'iss'].forEach(Set.prototype.delete.bind(missingOIDCClaims)) %>
<% if (missingOIDCClaims.size) { %>
<li>claims:</li>
<ul>
<% missingOIDClaims.forEach((claim) => { %>
<% missingOIDCClaims.forEach((claim) => { %>
<li><%= claim %></li>
<% }) %>
</ul>
Expand Down
4 changes: 2 additions & 2 deletions lib/actions/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ your configuration is not in effect');
if (details.missingOIDCScope) {
grant.addOIDCScope(details.missingOIDCScope.join(' '));
}
if (details.missingOIDClaims) {
grant.addOIDCClaims(details.missingOIDClaims);
if (details.missingOIDCClaims) {
grant.addOIDCClaims(details.missingOIDCClaims);
}
if (details.missingResourceScopes) {
// eslint-disable-next-line no-restricted-syntax
Expand Down
6 changes: 3 additions & 3 deletions lib/helpers/interaction_policy/prompts/consent.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const Prompt = require('../prompt');
const Check = require('../check');

const missingOIDCScope = Symbol('op_scopes_missing');
const missingOIDClaims = Symbol('op_claims_missing');
const missingOIDCClaims = Symbol('op_claims_missing');
const missingResourceScopes = Symbol('rs_scopes_missing');

module.exports = () => new Prompt(
Expand Down Expand Up @@ -57,12 +57,12 @@ module.exports = () => new Prompt(
}

if (missing && missing.length) {
ctx.oidc[missingOIDClaims] = missing;
ctx.oidc[missingOIDCClaims] = missing;
return Check.REQUEST_PROMPT;
}

return Check.NO_NEED_TO_PROMPT;
}, ({ oidc }) => ({ missingOIDClaims: oidc[missingOIDClaims] })),
}, ({ oidc }) => ({ missingOIDCClaims: oidc[missingOIDCClaims] })),

// checks resource server scopes
new Check('rs_scopes_missing', 'requested scopes not granted', (ctx) => {
Expand Down
8 changes: 4 additions & 4 deletions lib/views/interaction.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module.exports = `<div class="login-client-image">
</div>
<ul>
<% if ([details.missingOIDCScope, details.missingOIDClaims, details.missingResourceScopes].filter(Boolean).length === 0) { %>
<% if ([details.missingOIDCScope, details.missingOIDCClaims, details.missingResourceScopes].filter(Boolean).length === 0) { %>
<li>the client is asking you to confirm previously given authorization</li>
<% } %>
Expand All @@ -17,11 +17,11 @@ module.exports = `<div class="login-client-image">
</ul>
<% } %>
<% missingOIDClaims = new Set(details.missingOIDClaims); ['sub', 'sid', 'auth_time', 'acr', 'amr', 'iss'].forEach(Set.prototype.delete.bind(missingOIDClaims)) %>
<% if (missingOIDClaims.size) { %>
<% missingOIDCClaims = new Set(details.missingOIDCClaims); ['sub', 'sid', 'auth_time', 'acr', 'amr', 'iss'].forEach(Set.prototype.delete.bind(missingOIDCClaims)) %>
<% if (missingOIDCClaims.size) { %>
<li>claims:</li>
<ul>
<% missingOIDClaims.forEach((claim) => { %>
<% missingOIDCClaims.forEach((claim) => { %>
<li><%= claim %></li>
<% }) %>
</ul>
Expand Down

0 comments on commit 1427383

Please sign in to comment.