diff --git a/package-lock.json b/package-lock.json index b7e3b56..3fbd2f6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.14.0", "license": "MIT", "dependencies": { - "@workos-inc/authkit-js": "0.14.0" + "@workos-inc/authkit-js": "0.17.0" }, "devDependencies": { "@types/react": "18.3.3", @@ -794,9 +794,9 @@ } }, "node_modules/@workos-inc/authkit-js": { - "version": "0.14.0", - "resolved": "https://registry.npmjs.org/@workos-inc/authkit-js/-/authkit-js-0.14.0.tgz", - "integrity": "sha512-Wt6rKoZdZnuAgiEBlvMDKhleU9DAwpyyy1SibacrnOWQgF4rcNlC+NTnHiiXu6OiOjQo6pPxhW42kCL+Gi+fjw==" + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@workos-inc/authkit-js/-/authkit-js-0.17.0.tgz", + "integrity": "sha512-3PKSf59M/IU4YzmeQs2brTe2pctvpTXbvci05BL+sk0unhqYs30zZzsha+6/9IYiaMVtCZWPdL5lrqIPA4echw==" }, "node_modules/acorn": { "version": "8.12.1", diff --git a/package.json b/package.json index 6a34962..6009aa9 100644 --- a/package.json +++ b/package.json @@ -37,6 +37,6 @@ "react": ">=17" }, "dependencies": { - "@workos-inc/authkit-js": "0.14.0" + "@workos-inc/authkit-js": "0.17.0" } } diff --git a/src/index.ts b/src/index.ts index e84835e..3784ec5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -7,6 +7,7 @@ export { } from "@workos-inc/authkit-js"; export type { User, + AuthenticationMethod, AuthenticationResponse, JWTPayload, OnRefreshResponse, diff --git a/src/provider.tsx b/src/provider.tsx index 486e9d8..1f61575 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -40,6 +40,7 @@ export function AuthKitProvider(props: AuthKitProviderProps) { accessToken, organizationId = null, impersonator = null, + authenticationMethod = null, } = response; const { role = null, @@ -57,6 +58,7 @@ export function AuthKitProvider(props: AuthKitProviderProps) { permissions, featureFlags, impersonator, + authenticationMethod, }; return isEquivalentWorkOSSession(prev, next) ? prev : next; }); @@ -127,7 +129,8 @@ function isEquivalentWorkOSSession( a.featureFlags.length === b.featureFlags.length && a.featureFlags.every((flag, i) => flag === b.featureFlags[i]) && a.impersonator?.email === b.impersonator?.email && - a.impersonator?.reason === b.impersonator?.reason + a.impersonator?.reason === b.impersonator?.reason && + a.authenticationMethod === b.authenticationMethod ); } diff --git a/src/state.ts b/src/state.ts index a030451..aee8343 100644 --- a/src/state.ts +++ b/src/state.ts @@ -1,4 +1,4 @@ -import { User } from "@workos-inc/authkit-js"; +import { User, AuthenticationMethod } from "@workos-inc/authkit-js"; export interface Impersonator { email: string; @@ -14,6 +14,7 @@ export interface State { permissions: string[]; featureFlags: string[]; impersonator: Impersonator | null; + authenticationMethod: AuthenticationMethod | null; } export const initialState: State = { @@ -25,4 +26,5 @@ export const initialState: State = { permissions: [], featureFlags: [], impersonator: null, + authenticationMethod: null, };