@thunderid/nextjs 0.1.0 → 0.2.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.
Files changed (31) hide show
  1. package/README.md +2 -1
  2. package/dist/{SessionManager-B5tAUogZ.js → SessionManager-BPpyyzfa.js} +23 -23
  3. package/dist/{cache-CehR-2Mf.js → cache-B9tFVOO5.js} +114 -114
  4. package/dist/cjs/{SessionManager-DWVXWxai.js → SessionManager-SBxwYnwV.js} +23 -23
  5. package/dist/cjs/{cache-DWfaHdaR.js → cache-0QwhuLuy.js} +114 -114
  6. package/dist/cjs/{dynamic-rendering-BEGH3rlw.js → dynamic-rendering-W7rdgerZ.js} +32 -32
  7. package/dist/cjs/{getAccessToken-Cab1Sj9F.js → getAccessToken-EiHUciAb.js} +2 -2
  8. package/dist/cjs/getSessionId-BUDHvxX2.js +5 -0
  9. package/dist/cjs/{getSessionId-JO0wYM7v.js → getSessionId-Do242Vmz.js} +2 -2
  10. package/dist/cjs/index.cjs +11 -7
  11. package/dist/cjs/index2.cjs +5 -5
  12. package/dist/cjs/middleware.cjs +106 -106
  13. package/dist/cjs/{segment-CykhDxJi.js → segment-CPZPzHDj.js} +3 -3
  14. package/dist/cjs/{server-CClKGlqg.js → server-BAGHs6kk.js} +57 -55
  15. package/dist/{dynamic-rendering-_qvcT_hy.js → dynamic-rendering-CkPpk5pF.js} +32 -32
  16. package/dist/{getAccessToken-v55M0pXz.js → getAccessToken-DCP_zasP.js} +2 -2
  17. package/dist/{getSessionId-Do76d3V9.js → getSessionId-Ctmvpfgp.js} +2 -2
  18. package/dist/getSessionId-pG-rZbaH.js +5 -0
  19. package/dist/index.js +11 -7
  20. package/dist/index2.js +5 -5
  21. package/dist/middleware.js +106 -106
  22. package/dist/{segment-CyPl-lBr.js → segment-D3vdYYI5.js} +3 -3
  23. package/dist/{server-DIFI4QvJ.js → server-Bn2BrWaL.js} +57 -55
  24. package/dist/types/ThunderIDNextClient.d.ts.map +1 -1
  25. package/dist/types/client/components/presentation/SignUp/SignUp.d.ts.map +1 -1
  26. package/dist/types/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
  27. package/dist/types/server/actions/switchOrganization.d.ts.map +1 -1
  28. package/dist/types/server/thunderid.d.ts.map +1 -1
  29. package/package.json +4 -4
  30. package/dist/cjs/getSessionId-D2GHhpYA.js +0 -5
  31. package/dist/getSessionId-C83kPHvR.js +0 -5
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import { v as __toESM } from "./dynamic-rendering-_qvcT_hy.js";
2
- import "./SessionManager-B5tAUogZ.js";
3
- import { a as logger_default, c as ThunderIDNextClient_default, i as require_navigation, n as require_jsx_runtime, o as thunderid_default, r as ThunderIDContext_default, s as getClient_default, t as ThunderIDProvider_default } from "./server-DIFI4QvJ.js";
4
- import { t as getSessionId_default } from "./getSessionId-Do76d3V9.js";
5
- import "./segment-CyPl-lBr.js";
1
+ import { v as __toESM } from "./dynamic-rendering-CkPpk5pF.js";
2
+ import "./SessionManager-BPpyyzfa.js";
3
+ import { a as logger_default, c as ThunderIDNextClient_default, i as require_navigation, n as require_jsx_runtime, o as thunderid_default, r as ThunderIDContext_default, s as getClient_default, t as ThunderIDProvider_default } from "./server-Bn2BrWaL.js";
4
+ import { t as getSessionId_default } from "./getSessionId-Ctmvpfgp.js";
5
+ import "./segment-D3vdYYI5.js";
6
6
  import { EmbeddedFlowType, ThunderIDRuntimeError, createPatchOperations, updateOrganization } from "@thunderid/node";
7
7
  import { forwardRef, useContext, useEffect, useState } from "react";
8
8
  import { BaseCreateOrganization, BaseOrganization, BaseOrganizationList, BaseOrganizationProfile, BaseOrganizationSwitcher, BaseSignIn, BaseSignInButton, BaseSignOutButton, BaseSignUp, BaseSignUpButton, BaseUser, BaseUserDropdown, BaseUserProfile, BuildingAlt, useOrganization, useTranslation, useUser } from "@thunderid/react";
@@ -806,13 +806,17 @@ var User_default = User;
806
806
  * ```
807
807
  */
808
808
  const SignUp = ({ className, size = "medium", variant = "outlined", afterSignUpUrl, onError }) => {
809
- const { signUp } = useThunderID_default();
809
+ const { signUp, applicationId: contextApplicationId, scopes } = useThunderID_default();
810
810
  /**
811
811
  * Initialize the sign-up flow.
812
812
  */
813
813
  const handleInitialize = async (payload) => {
814
814
  if (!signUp) throw new ThunderIDRuntimeError("`signUp` function is not available.", "SignUp-handleInitialize-RuntimeError-001", "nextjs");
815
- return await signUp(payload || { flowType: EmbeddedFlowType.Registration });
815
+ return await signUp(payload || {
816
+ flowType: EmbeddedFlowType.Registration,
817
+ ...contextApplicationId && { applicationId: contextApplicationId },
818
+ ...scopes && { scopes }
819
+ });
816
820
  };
817
821
  /**
818
822
  * Handle sign-up steps.
package/dist/index2.js CHANGED
@@ -1,7 +1,7 @@
1
- import "./dynamic-rendering-_qvcT_hy.js";
2
- import "./SessionManager-B5tAUogZ.js";
3
- import { o as thunderid_default, t as ThunderIDProvider_default } from "./server-DIFI4QvJ.js";
4
- import "./getSessionId-Do76d3V9.js";
5
- import "./segment-CyPl-lBr.js";
1
+ import "./dynamic-rendering-CkPpk5pF.js";
2
+ import "./SessionManager-BPpyyzfa.js";
3
+ import { o as thunderid_default, t as ThunderIDProvider_default } from "./server-Bn2BrWaL.js";
4
+ import "./getSessionId-Ctmvpfgp.js";
5
+ import "./segment-D3vdYYI5.js";
6
6
 
7
7
  export { ThunderIDProvider_default as ThunderIDProvider, thunderid_default as thunderid };