MCPcopy Create free account
hub / github.com/FlowiseAI/Flowise / extractOAuth2TokenFields

Function extractOAuth2TokenFields

packages/server/src/utils/oauth2Security.ts:78–90  ·  view source on GitHub ↗
(data: Record<string, any>)

Source from the content-addressed store, hash-verified

76 * @throws Error if the data is not a valid object (null, undefined, array, or primitive type)
77 */
78export function extractOAuth2TokenFields(data: Record<string, any>): Record<string, any> {
79 if (!data || typeof data !== 'object' || Array.isArray(data)) {
80 throw new Error('Invalid OAuth2 token response: expected an object')
81 }
82
83 const result: Record<string, any> = {}
84 for (const key of ALLOWED_OAUTH2_TOKEN_FIELDS) {
85 if (data[key] !== undefined) {
86 result[key] = data[key]
87 }
88 }
89 return result
90}

Callers 2

index.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected