Skip to content

Commit

Permalink
Merge pull request #220 from savindi7/v4.0.3-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 14, 2024
2 parents 9925030 + 7a2b63c commit d01b903
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": "^3.0.1"
"@asgardeo/auth-spa": "^3.0.2"
},
"devDependencies": {
"@babel/cli": "^7.19.3",
Expand Down
5 changes: 3 additions & 2 deletions lib/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -410,10 +410,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 @@ -131,7 +131,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 @@ -113,7 +113,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 @@ -15,10 +15,10 @@
resolved "https://registry.yarnpkg.com/@asgardeo/auth-js/-/auth-js-5.0.0.tgz#ad63c232ac0588363e95c54d576c6318a6d4be93"
integrity sha512-BMQsTzpFwtgbSeJvmSDgRrOjXfA6+yQ2NUq7CXP4q1TtqZJt8s/zadOazPM00/jIY8B2ENS0CLRHp07M0mFdOw==

"@asgardeo/auth-spa@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-3.0.1.tgz#94237193446b48eecc9d6bd780ece1124cccdcd7"
integrity sha512-GJWDpNaU2GE6hkelc+B4fuKMJ6PwHEq0WsktZ8cjW/EKtqL6z7WU+ywDzQFMZRTBAdTofkY2qVms53I8hI8LOg==
"@asgardeo/auth-spa@^3.0.2":
version "3.0.2"
resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-3.0.2.tgz#1827067d36482ac142a48defa45fa82c785e81bc"
integrity sha512-z25jzo+vQAju0wIplsQmHfczd+SwWy/cFRt9Dlnv+3dhb7ofygTD5to4nuvDA9DtW775qHl7XHi5R2M5xChJaQ==
dependencies:
"@asgardeo/auth-js" "^5.0.0"
await-semaphore "^0.1.3"
Expand Down

0 comments on commit d01b903

Please sign in to comment.