diff --git a/lib/package.json b/lib/package.json index 872c1d18..cbc4b640 100755 --- a/lib/package.json +++ b/lib/package.json @@ -37,7 +37,7 @@ "author": "WSO2", "license": "Apache-2.0", "dependencies": { - "@asgardeo/auth-spa": "^0.4.14" + "@asgardeo/auth-spa": "^0.4.15" }, "devDependencies": { "@babel/cli": "^7.10.5", diff --git a/lib/src/api.ts b/lib/src/api.ts index c0cd7fde..61ba82ce 100644 --- a/lib/src/api.ts +++ b/lib/src/api.ts @@ -401,10 +401,11 @@ class AuthAPI { */ public async trySignInSilently( state: AuthStateInterface, - dispatch: (state: AuthStateInterface) => void + dispatch: (state: AuthStateInterface) => void, + additionalParams?: Record ): Promise { return this._client - .trySignInSilently() + .trySignInSilently(additionalParams) .then(async (response: BasicUserInfo | boolean) => { if (!response) { this.updateState({ ...this.getState(), isLoading: false }); diff --git a/lib/src/authenticate.tsx b/lib/src/authenticate.tsx index 0535cc6d..61327745 100644 --- a/lib/src/authenticate.tsx +++ b/lib/src/authenticate.tsx @@ -130,7 +130,9 @@ const AuthProvider: FunctionComponent AuthClient.trySignInSilently(state, dispatch); + const trySignInSilently = ( + additionalParams?: Record + ) => AuthClient.trySignInSilently(state, dispatch, additionalParams); const [ error, setError ] = useState(); const reRenderCheckRef: MutableRefObject = useRef(false); diff --git a/lib/src/models.ts b/lib/src/models.ts index 36566592..fc2cc9e2 100644 --- a/lib/src/models.ts +++ b/lib/src/models.ts @@ -112,7 +112,7 @@ export interface AuthContextInterface { enableHttpHandler(): Promise; disableHttpHandler(): Promise; updateConfig(config: Partial>): Promise; - trySignInSilently: () => Promise; + trySignInSilently: (additionalParams?: Record) => Promise; on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): void; on( hook: Exclude, diff --git a/yarn.lock b/yarn.lock index 0c9c195f..0cc6854f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,10 +14,10 @@ resolved "https://registry.yarnpkg.com/@asgardeo/auth-js/-/auth-js-2.0.15.tgz#1fae42052b5a4bc15bc55e193793ca33f164597e" integrity sha512-ciMLhrm/M//CvyMpCvaoA82S3tKvB529L+MwKKBbRZFe+d0HRPuDfruDhclWl7i07XO1+AVp9Dy1MdUDkhzR4Q== -"@asgardeo/auth-spa@^0.4.14": - version "0.4.14" - resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-0.4.14.tgz#4f67591b059c31b3db107d371be27fb274daa467" - integrity sha512-Eh1eBflbOftdeS42uy5yLYHW+G12dPQkdQRbQ52MMXYN212RXatqTzjtzS3f8xJs6i3qZGGI6LXdrav7ksJFXQ== +"@asgardeo/auth-spa@^0.4.15": + version "0.4.15" + resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-0.4.15.tgz#d0f1d0564b95adca90f529443a663251ff2a54cf" + integrity sha512-LPET7MTF5LMMoB9M73X1+HWQEbOleib3GG2GR8QnHCOQSe/omWpgnV1W9O7977vStrNwn7iMxrG9bN/PhfhNiA== dependencies: "@asgardeo/auth-js" "^2.0.15" await-semaphore "^0.1.3"