From e818aafcfe5ebd2a6a464d0946d3604354cee5ad Mon Sep 17 00:00:00 2001 From: Joshua Kelly Date: Thu, 16 Dec 2021 10:26:11 -0500 Subject: [PATCH] feat: change signature of getAccessTokenFromClientCredentialFlow * Matches the other signatures now * Should return a Promise with an optional error in some uniform way in the future --- src/smart-auth/index.ts | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/smart-auth/index.ts b/src/smart-auth/index.ts index 0053a08..6f8bad8 100644 --- a/src/smart-auth/index.ts +++ b/src/smart-auth/index.ts @@ -221,7 +221,7 @@ const oauthPlugin: FastifyPluginCallback> = fu export const getAccessTokenFromClientCredentialFlow = async ( smartAuthProvider: SmartAuthProvider, scope?: string[] -): Promise => { +): Promise => { const clientCredentialsOptions = { client: smartAuthProvider.client, auth: { @@ -236,11 +236,7 @@ export const getAccessTokenFromClientCredentialFlow = async ( ...smartAuthProvider.auth.tokenParams } - try { - return await client.getToken(params); - } catch (error: any) { - console.log('Access Token error', error.message); - } + return await client.getToken(params); }; export default fastifyPlugin(oauthPlugin, {