Skip to content

Commit feb9ecd

Browse files
committed
chore: resolve a CodeQL syntax error
1 parent 8df6dec commit feb9ecd

File tree

7 files changed

+14
-4
lines changed

7 files changed

+14
-4
lines changed

lib/actions/grants/authorization_code.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -244,3 +244,5 @@ export const handler = async function authorizationCodeHandler(ctx) {
244244
};
245245

246246
export const parameters = new Set(['code', 'code_verifier', 'redirect_uri']);
247+
248+
export const grantType = gty;

lib/actions/grants/ciba.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,3 +238,5 @@ export const handler = async function cibaHandler(ctx) {
238238
};
239239

240240
export const parameters = new Set(['auth_req_id']);
241+
242+
export const grantType = 'urn:openid:params:grant-type:ciba';

lib/actions/grants/client_credentials.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,5 @@ export const handler = async function clientCredentialsHandler(ctx) {
8888
};
8989

9090
export const parameters = new Set(['scope']);
91+
92+
export const grantType = 'client_credentials';

lib/actions/grants/device_code.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,5 @@ export const handler = async function deviceCodeHandler(ctx) {
237237
};
238238

239239
export const parameters = new Set(['device_code']);
240+
241+
export const grantType = 'urn:ietf:params:oauth:grant-type:device_code';

lib/actions/grants/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,5 @@
33
export * as authorization_code from './authorization_code.js';
44
export * as client_credentials from './client_credentials.js';
55
export * as refresh_token from './refresh_token.js';
6-
export * as 'urn:ietf:params:oauth:grant-type:device_code' from './device_code.js';
7-
export * as 'urn:openid:params:grant-type:ciba' from './ciba.js';
6+
export * as device_code from './device_code.js';
7+
export * as ciba from './ciba.js';

lib/actions/grants/refresh_token.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,3 +266,5 @@ export const handler = async function refreshTokenHandler(ctx) {
266266
};
267267

268268
export const parameters = new Set(['refresh_token', 'scope']);
269+
270+
export const grantType = gty;

lib/helpers/initialize_app.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export default function initializeApp() {
8888

8989
const { routes, enableHttpPostMethods } = configuration;
9090

91-
Object.entries(grants).forEach(([grantType, { handler, parameters }]) => {
91+
for (const { handler, parameters, grantType } of Object.values(grants)) {
9292
const { grantTypeHandlers } = instance(this);
9393
if (configuration.grantTypes.has(grantType) && !grantTypeHandlers.has(grantType)) {
9494
let dupes;
@@ -101,7 +101,7 @@ export default function initializeApp() {
101101
}
102102
this.registerGrantType(grantType, handler, parameters, dupes);
103103
}
104-
});
104+
}
105105

106106
['query', 'fragment', 'form_post'].forEach((mode) => {
107107
this.registerResponseMode(mode, responseModes[mode]);

0 commit comments

Comments
 (0)