Skip to content

Commit

Permalink
Merge pull request #76 from thivi/main
Browse files Browse the repository at this point in the history
Bump auth SPA SDK version
  • Loading branch information
thivi authored Jan 12, 2022
2 parents 7c0342c + 86fa2b4 commit d67c1d5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"author": "WSO2",
"license": "Apache-2.0",
"dependencies": {
"@asgardeo/auth-spa": "^0.2.18"
"@asgardeo/auth-spa": "^0.2.19"
},
"devDependencies": {
"@babel/cli": "^7.10.5",
Expand Down
12 changes: 6 additions & 6 deletions lib/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import {
AuthClientConfig,
BasicUserInfo,
Config,
CustomGrantConfig,
DecodedIDTokenPayload,
Hooks,
HttpClientInstance,
Expand All @@ -30,6 +29,7 @@ import {
OIDCEndpoints,
SignInConfig
} from "@asgardeo/auth-spa";
import { SPACustomGrantConfig } from "@asgardeo/auth-spa/src/models/request-custom-grant";
import { AuthStateInterface } from "./models";

class AuthAPI {
Expand Down Expand Up @@ -197,7 +197,7 @@ class AuthAPI {
* the value returned by the custom grant request.
*/
public requestCustomGrant(
config: CustomGrantConfig,
config: SPACustomGrantConfig,
callback: (response: BasicUserInfo | HttpResponse<any>) => void,
dispatch: (state: AuthStateInterface) => void
): Promise<BasicUserInfo | HttpResponse<any>> {
Expand Down Expand Up @@ -405,9 +405,9 @@ class AuthAPI {
email: basicUserInfo.email,
isAuthenticated: true,
isLoading: false,
username: basicUserInfo.username,
isSigningOut: false,
sub: basicUserInfo.sub
sub: basicUserInfo.sub,
username: basicUserInfo.username
};

this.updateState(stateToUpdate);
Expand All @@ -429,8 +429,8 @@ AuthAPI.DEFAULT_STATE = {
email: "",
isAuthenticated: false,
isLoading: true,
username: "",
sub: ""
sub: "",
username: ""
};

export default AuthAPI;
14 changes: 7 additions & 7 deletions lib/src/authenticate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,22 @@
import {
AuthClientConfig,
BasicUserInfo,
CustomGrantConfig,
Hooks,
HttpRequestConfig,
HttpResponse,
SignInConfig,
SPAUtils
SPAUtils,
SignInConfig
} from "@asgardeo/auth-spa";
import { SPACustomGrantConfig } from "@asgardeo/auth-spa/src/models/request-custom-grant";
import React, {
FunctionComponent,
PropsWithChildren,
ReactNode,
createContext,
useContext,
useEffect,
useMemo,
useState,
ReactNode
useState
} from "react";
import { AuthParams, ReactConfig } from ".";
import AuthAPI from "./api";
Expand Down Expand Up @@ -88,7 +88,7 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
const httpRequest = (config: HttpRequestConfig) => AuthClient.httpRequest(config);
const httpRequestAll = (configs: HttpRequestConfig[]) => AuthClient.httpRequestAll(configs);
const requestCustomGrant = (
config: CustomGrantConfig,
config: SPACustomGrantConfig,
callback?: (response: BasicUserInfo | HttpResponse<any>) => void
) => AuthClient.requestCustomGrant(config, callback, dispatch);
const revokeAccessToken = () => AuthClient.revokeAccessToken(dispatch);
Expand Down Expand Up @@ -178,7 +178,7 @@ const AuthProvider: FunctionComponent<PropsWithChildren<AuthProviderPropsInterfa
// This uses the RP iframe to get the session. Hence, will not work if 3rd party cookies are disabled.
// If the browser has these cookies disabled, we'll not be able to retrieve the session on refreshes.
await trySignInSilently()
.then((_: BasicUserInfo | boolean) => {
.then(() => {
// TODO: Add logs when a logger is available.
// Tracked here https://github.com/asgardeo/asgardeo-auth-js-sdk/issues/151.
})
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
jose "^3.1.2"
randombytes "^2.1.0"

"@asgardeo/auth-spa@^0.2.18":
version "0.2.18"
resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-0.2.18.tgz#3c9832ef906f3975ac42bdd0b1246d7d23ee307e"
integrity sha512-FPjL0A+bKdQkNeashwS2WbJ7O6Jyr9zniUTToTmRMIflOeB7bm4SsIbWYJqZQ6rkMTo5I+CI/ojy8YWeavg7UQ==
"@asgardeo/auth-spa@^0.2.19":
version "0.2.19"
resolved "https://registry.yarnpkg.com/@asgardeo/auth-spa/-/auth-spa-0.2.19.tgz#577ffcd87cf9e7c42910e79f2f41d05854004cd4"
integrity sha512-dowGFyBPsDS4c2eC/94pmMxdEkmKLfwJ0O+jYhWcOTI4HqI3tE/BEgMSEQBIowmUkYwj2RZsZZGQXS3ewShgxw==
dependencies:
"@asgardeo/auth-js" "0.2.20"
"@babel/runtime-corejs3" "^7.11.2"
Expand Down

0 comments on commit d67c1d5

Please sign in to comment.