Skip to content

Commit

Permalink
Merge pull request #219 from savindi7/v1.1.25-pre-release
Browse files Browse the repository at this point in the history
Support additional params in trySignInSilently URL and bump auth-spa
  • Loading branch information
savindi7 authored Mar 13, 2024
2 parents dc03dc2 + 8e45f91 commit 6a7856b
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions lib/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -401,10 +401,11 @@ class AuthAPI {
*/
public async trySignInSilently(
state: AuthStateInterface,
dispatch: (state: AuthStateInterface) => void
dispatch: (state: AuthStateInterface) => void,
additionalParams?: Record<string, string | boolean>
): Promise<BasicUserInfo | boolean | undefined> {
return this._client
.trySignInSilently()
.trySignInSilently(additionalParams)
.then(async (response: BasicUserInfo | boolean) => {
if (!response) {
this.updateState({ ...this.getState(), isLoading: false });
Expand Down
4 changes: 3 additions & 1 deletion lib/src/authenticate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa

return AuthClient.on(hook, callback);
};
const trySignInSilently = () => AuthClient.trySignInSilently(state, dispatch);
const trySignInSilently = (
additionalParams?: Record<string, string | boolean>
) => AuthClient.trySignInSilently(state, dispatch, additionalParams);

const [ error, setError ] = useState<AsgardeoAuthException>();
const reRenderCheckRef: MutableRefObject<boolean> = useRef(false);
Expand Down
2 changes: 1 addition & 1 deletion lib/src/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export interface AuthContextInterface {
enableHttpHandler(): Promise<boolean>;
disableHttpHandler(): Promise<boolean>;
updateConfig(config: Partial<AuthClientConfig<Config>>): Promise<void>;
trySignInSilently: () => Promise<boolean | BasicUserInfo>;
trySignInSilently: (additionalParams?: Record<string, string | boolean>) => Promise<boolean | BasicUserInfo>;
on(hook: Hooks.CustomGrant, callback: (response?: any) => void, id: string): void;
on(
hook: Exclude<Hooks, Hooks.CustomGrant>,
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6a7856b

Please sign in to comment.