fix minor bug

This commit is contained in:
Malte Teichert
2024-05-20 18:47:32 +02:00
parent a0cc87c96c
commit 54a81a2fbe

View File

@@ -8,8 +8,15 @@
let availableFlows: string[] = ['implicit', 'password', 'clientCredentials', 'authorizationCode']; let availableFlows: string[] = ['implicit', 'password', 'clientCredentials', 'authorizationCode'];
// remove flows that are already in Object.keys(schema.flows) // remove flows that are already in Object.keys(schema.flows)
// @ts-expect-error - security schema definition is lacking a bit availableFlows = availableFlows.filter((flow) => {
availableFlows = availableFlows.filter((flow) => !Object.keys(schema.flows).includes(flow)); // if flows is not defined: skip
// @ts-expect-error - security schema definition is lacking a bit
if (!schema.flows) return;
// if schema.flows check if flow already is a key
// @ts-expect-error - security schema definition is lacking a bit
return !Object.keys(schema.flows).includes(flow);
});
let flowType: string; let flowType: string;
const addOauthFlow = () => { const addOauthFlow = () => {