From e22c7ccdafb2f34520b49ffb4e162b2dbbdfa60b Mon Sep 17 00:00:00 2001 From: Kavith Lokuhewage Date: Wed, 24 Jul 2024 14:59:57 +0530 Subject: [PATCH] Support custom params for token request --- lib/src/api.ts | 7 +++++-- lib/src/authenticate.tsx | 8 ++++++-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/src/api.ts b/lib/src/api.ts index 1682bcd..c0c35d4 100644 --- a/lib/src/api.ts +++ b/lib/src/api.ts @@ -81,10 +81,13 @@ class AuthAPI { authorizationCode: string, sessionState: string, authState?: string, - callback?: (response: BasicUserInfo) => void + callback?: (response: BasicUserInfo) => void, + tokenRequestConfig?: { + params: Record + } ): Promise { return this._client - .signIn(config, authorizationCode, sessionState, authState) + .signIn(config, authorizationCode, sessionState, authState, tokenRequestConfig) .then(async (response: BasicUserInfo) => { if (!response) { return; diff --git a/lib/src/authenticate.tsx b/lib/src/authenticate.tsx index cec5164..8f10ec7 100644 --- a/lib/src/authenticate.tsx +++ b/lib/src/authenticate.tsx @@ -85,7 +85,10 @@ const AuthProvider: FunctionComponent void + callback?: (response: BasicUserInfo) => void, + tokenRequestConfig?: { + params: Record + } ): Promise => { try { setError(null); @@ -96,7 +99,8 @@ const AuthProvider: FunctionComponent