@stytch/nextjs 21.12.0 → 21.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # @stytch/nextjs
2
2
 
3
+ ## 21.13.0
4
+
5
+ ### Minor Changes
6
+
7
+ - bd48584: Store last used OAuth and SSO method locally and move it to the top of the list the next time users visit the log in page.
8
+ Add "provider.lastUsed" translation string for "Last used" text indicating the last used auth method.
9
+
3
10
  ## 21.12.0
4
11
 
5
12
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, useContext, useEffect, useMemo, useCallback, useRef } from 'react';
2
- import { i as invariant, u as useAsyncState, m as mergeWithStableProps } from './useIsomorphicLayoutEffect-681e2138.js';
2
+ import { i as invariant, u as useAsyncState, m as mergeWithStableProps } from './useIsomorphicLayoutEffect-3bc90e37.js';
3
3
  import { i as isStytchSSRProxy, n as noProviderError } from './StytchSSRProxy-34c789b5.js';
4
4
 
5
5
  const initialMember = {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var React = require('react');
4
- var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-672e4b66.js');
4
+ var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-35a9b44b.js');
5
5
  var StytchSSRProxy = require('./StytchSSRProxy-86bc42b3.js');
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
@@ -1,9 +1,9 @@
1
1
  import { mountAdminPortalSSO, mountAdminPortalOrgSettings, mountAdminPortalMemberManagement, mountAdminPortalSCIM } from '@stytch/vanilla-js/b2b/adminPortal';
2
2
  export { AdminPortalB2BProducts } from '@stytch/vanilla-js/b2b/adminPortal';
3
3
  import React, { useRef } from 'react';
4
- import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-1cabb03b.js';
4
+ import { u as useIsMounted__INTERNAL, a as useStytchB2BClient } from '../StytchB2BContext-adf1a291.js';
5
5
  import { n as noProviderError } from '../StytchSSRProxy-34c789b5.js';
6
- import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-681e2138.js';
6
+ import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-3bc90e37.js';
7
7
 
8
8
  const makeAdminPortalComponent = (mountFn, componentName) => {
9
9
  const Component = (props) => {
@@ -4,9 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var adminPortal = require('@stytch/vanilla-js/b2b/adminPortal');
6
6
  var React = require('react');
7
- var StytchB2BContext = require('../StytchB2BContext-f7acf57f.js');
7
+ var StytchB2BContext = require('../StytchB2BContext-dad97135.js');
8
8
  var StytchSSRProxy = require('../StytchSSRProxy-86bc42b3.js');
9
- var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-672e4b66.js');
9
+ var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-35a9b44b.js');
10
10
 
11
11
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
12
12
 
@@ -149,8 +149,8 @@ declare const StytchB2B: <TProjectConfiguration extends Partial<import("@stytch/
149
149
  * />
150
150
  */
151
151
  declare const B2BIdentityProvider: ({ styles, callbacks, getIDPConsentManifest, trustedAuthTokenParams }: B2BIdentityProviderProps) => React.JSX.Element;
152
- export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-f7acf57f.js";
152
+ export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-dad97135.js";
153
153
  export { StytchB2B, B2BIdentityProvider };
154
- export type { StytchB2BProviderProps } from "../StytchB2BContext-f7acf57f.js";
154
+ export type { StytchB2BProviderProps } from "../StytchB2BContext-dad97135.js";
155
155
  export { parseOAuthAuthorizeParams, parseOAuthLogoutParams } from '@stytch/vanilla-js';
156
156
  export type { OAuthAuthorizeParams, OAuthLogoutParams } from '@stytch/vanilla-js';
@@ -149,8 +149,8 @@ declare const StytchB2B: <TProjectConfiguration extends Partial<import("@stytch/
149
149
  * />
150
150
  */
151
151
  declare const B2BIdentityProvider: ({ styles, callbacks, getIDPConsentManifest, trustedAuthTokenParams }: B2BIdentityProviderProps) => React.JSX.Element;
152
- export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-1cabb03b.js";
152
+ export { StytchB2BProvider, useStytchB2BClient, useStytchMemberSession, useStytchMember, useStytchIsAuthorized, useStytchOrganization, withStytchB2BClient, withStytchMemberSession, withStytchMember, withStytchOrganization, withStytchPermissions } from "../StytchB2BContext-adf1a291.js";
153
153
  export { StytchB2B, B2BIdentityProvider };
154
- export type { StytchB2BProviderProps } from "../StytchB2BContext-1cabb03b.js";
154
+ export type { StytchB2BProviderProps } from "../StytchB2BContext-adf1a291.js";
155
155
  export { parseOAuthAuthorizeParams, parseOAuthLogoutParams } from '@stytch/vanilla-js';
156
156
  export type { OAuthAuthorizeParams, OAuthLogoutParams } from '@stytch/vanilla-js';
@@ -1,7 +1,7 @@
1
- import { u as useIsMounted__INTERNAL, a as useStytchB2BClient, i as isUIClient, b as useStytchMember } from '../StytchB2BContext-1cabb03b.js';
2
- export { S as StytchB2BProvider, a as useStytchB2BClient, d as useStytchIsAuthorized, b as useStytchMember, c as useStytchMemberSession, e as useStytchOrganization, w as withStytchB2BClient, g as withStytchMember, f as withStytchMemberSession, h as withStytchOrganization, j as withStytchPermissions } from '../StytchB2BContext-1cabb03b.js';
1
+ import { u as useIsMounted__INTERNAL, a as useStytchB2BClient, i as isUIClient, b as useStytchMember } from '../StytchB2BContext-adf1a291.js';
2
+ export { S as StytchB2BProvider, a as useStytchB2BClient, d as useStytchIsAuthorized, b as useStytchMember, c as useStytchMemberSession, e as useStytchOrganization, w as withStytchB2BClient, g as withStytchMember, f as withStytchMemberSession, h as withStytchOrganization, j as withStytchPermissions } from '../StytchB2BContext-adf1a291.js';
3
3
  import React, { useRef } from 'react';
4
- import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-681e2138.js';
4
+ import { i as invariant, a as useIsomorphicLayoutEffect } from '../useIsomorphicLayoutEffect-3bc90e37.js';
5
5
  import { a as noHeadlessClientError, n as noProviderError } from '../StytchSSRProxy-34c789b5.js';
6
6
  export { parseOAuthAuthorizeParams, parseOAuthLogoutParams } from '@stytch/vanilla-js';
7
7
 
package/dist/b2b/index.js CHANGED
@@ -2,9 +2,9 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var StytchB2BContext = require('../StytchB2BContext-f7acf57f.js');
5
+ var StytchB2BContext = require('../StytchB2BContext-dad97135.js');
6
6
  var React = require('react');
7
- var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-672e4b66.js');
7
+ var useIsomorphicLayoutEffect = require('../useIsomorphicLayoutEffect-35a9b44b.js');
8
8
  var StytchSSRProxy = require('../StytchSSRProxy-86bc42b3.js');
9
9
  var vanillaJs = require('@stytch/vanilla-js');
10
10
 
@@ -1,2 +1,2 @@
1
1
  export { createDeepEqual } from "./createDeepEqual-5555f2e1.js";
2
- export { mergeWithStableProps } from "./useIsomorphicLayoutEffect-681e2138.js";
2
+ export { mergeWithStableProps } from "./useIsomorphicLayoutEffect-3bc90e37.js";
package/dist/index.esm.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import React, { createContext, useContext, useEffect, useMemo, useCallback, useRef } from 'react';
2
- import { i as invariant, u as useAsyncState, m as mergeWithStableProps, a as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect-681e2138.js';
2
+ import { i as invariant, u as useAsyncState, m as mergeWithStableProps, a as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect-3bc90e37.js';
3
3
  import { i as isStytchSSRProxy, n as noProviderError, p as providerMustBeUniqueError, a as noHeadlessClientError } from './StytchSSRProxy-34c789b5.js';
4
4
  export { parseOAuthAuthorizeParams, parseOAuthLogoutParams } from '@stytch/vanilla-js';
5
5
 
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var React = require('react');
6
- var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-672e4b66.js');
6
+ var useIsomorphicLayoutEffect = require('./useIsomorphicLayoutEffect-35a9b44b.js');
7
7
  var StytchSSRProxy = require('./StytchSSRProxy-86bc42b3.js');
8
8
  var vanillaJs = require('@stytch/vanilla-js');
9
9
 
@@ -65,7 +65,9 @@ const useAsyncState = (initialState) => {
65
65
  };
66
66
  }, []);
67
67
  const setStateAction = React.useCallback((newState) => {
68
- isMounted.current && setState(newState);
68
+ if (isMounted.current) {
69
+ setState(newState);
70
+ }
69
71
  }, []);
70
72
  return [state, setStateAction];
71
73
  };
@@ -63,7 +63,9 @@ const useAsyncState = (initialState) => {
63
63
  };
64
64
  }, []);
65
65
  const setStateAction = useCallback((newState) => {
66
- isMounted.current && setState(newState);
66
+ if (isMounted.current) {
67
+ setState(newState);
68
+ }
67
69
  }, []);
68
70
  return [state, setStateAction];
69
71
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stytch/nextjs",
3
- "version": "21.12.0",
3
+ "version": "21.13.0",
4
4
  "description": "Stytch's official Next.js Library",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.esm.js",
@@ -16,7 +16,8 @@
16
16
  "clean": "rm -rf ./dist",
17
17
  "compile": "rollup -c",
18
18
  "dev": "tsc -p tsconfig.build.json --watch",
19
- "test": "jest"
19
+ "test": "jest",
20
+ "typecheck": "tsc --noEmit"
20
21
  },
21
22
  "license": "MIT",
22
23
  "author": "Stytch",
@@ -25,9 +26,10 @@
25
26
  "@stytch/internal-tsconfigs": "0.0.0",
26
27
  "@stytch/jest-environment": "0.0.0",
27
28
  "@stytch/js-utils": "0.0.1",
28
- "@stytch/vanilla-js": "5.36.0",
29
+ "@stytch/vanilla-js": "5.38.0",
29
30
  "@testing-library/react": "14.0.0",
30
31
  "@types/jest": "29.5.14",
32
+ "@types/react": "18.3.26",
31
33
  "eslint-config-custom": "0.0.1",
32
34
  "jest": "29.7.0",
33
35
  "react": "18.2.0",