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'];
// remove flows that are already in Object.keys(schema.flows)
availableFlows = availableFlows.filter((flow) => {
// if flows is not defined: skip
// @ts-expect-error - security schema definition is lacking a bit
availableFlows = availableFlows.filter((flow) => !Object.keys(schema.flows).includes(flow));
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;
const addOauthFlow = () => {