@thunderid/nextjs 0.2.1 → 0.2.2
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/dist/{types/ThunderIDNextClient.d.ts → ThunderIDNextClient.d.ts} +1 -7
- package/dist/ThunderIDNextClient.d.ts.map +1 -0
- package/dist/ThunderIDNextClient.js +161 -0
- package/dist/ThunderIDNextClient.js.map +1 -0
- package/dist/cjs/ThunderIDNextClient.cjs +163 -0
- package/dist/cjs/ThunderIDNextClient.cjs.map +1 -0
- package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
- package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs +79 -0
- package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs.map +1 -0
- package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs +61 -0
- package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs.map +1 -0
- package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs +91 -0
- package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs.map +1 -0
- package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs +34 -0
- package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs.map +1 -0
- package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs +34 -0
- package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs.map +1 -0
- package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs +37 -0
- package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs.map +1 -0
- package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs +79 -0
- package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs.map +1 -0
- package/dist/cjs/client/components/presentation/User/User.cjs +49 -0
- package/dist/cjs/client/components/presentation/User/User.cjs.map +1 -0
- package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs +114 -0
- package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs.map +1 -0
- package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs +52 -0
- package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs.map +1 -0
- package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs +34 -0
- package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs.map +1 -0
- package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs +165 -0
- package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -0
- package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs +19 -0
- package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs.map +1 -0
- package/dist/cjs/client/index.cjs +11 -0
- package/dist/cjs/constants/sessionConstants.cjs +55 -0
- package/dist/cjs/constants/sessionConstants.cjs.map +1 -0
- package/dist/cjs/index.cjs +35 -990
- package/dist/cjs/server/ThunderIDProvider.cjs +114 -0
- package/dist/cjs/server/ThunderIDProvider.cjs.map +1 -0
- package/dist/cjs/server/actions/clearSession.cjs +41 -0
- package/dist/cjs/server/actions/clearSession.cjs.map +1 -0
- package/dist/cjs/server/actions/getAccessToken.cjs +27 -0
- package/dist/cjs/server/actions/getAccessToken.cjs.map +1 -0
- package/dist/cjs/server/actions/getClientOrigin.cjs +18 -0
- package/dist/cjs/server/actions/getClientOrigin.cjs.map +1 -0
- package/dist/cjs/server/actions/getSessionId.cjs +28 -0
- package/dist/cjs/server/actions/getSessionId.cjs.map +1 -0
- package/dist/cjs/server/actions/getSessionPayload.cjs +29 -0
- package/dist/cjs/server/actions/getSessionPayload.cjs.map +1 -0
- package/dist/cjs/server/actions/getUserAction.cjs +30 -0
- package/dist/cjs/server/actions/getUserAction.cjs.map +1 -0
- package/dist/cjs/server/actions/getUserProfileAction.cjs +34 -0
- package/dist/cjs/server/actions/getUserProfileAction.cjs.map +1 -0
- package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs +89 -0
- package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs.map +1 -0
- package/dist/cjs/server/actions/isSignedIn.cjs +40 -0
- package/dist/cjs/server/actions/isSignedIn.cjs.map +1 -0
- package/dist/cjs/server/actions/refreshToken.cjs +61 -0
- package/dist/cjs/server/actions/refreshToken.cjs.map +1 -0
- package/dist/cjs/server/actions/signInAction.cjs +95 -0
- package/dist/cjs/server/actions/signInAction.cjs.map +1 -0
- package/dist/cjs/server/actions/signOutAction.cjs +57 -0
- package/dist/cjs/server/actions/signOutAction.cjs.map +1 -0
- package/dist/cjs/server/actions/signUpAction.cjs +27 -0
- package/dist/cjs/server/actions/signUpAction.cjs.map +1 -0
- package/dist/cjs/server/actions/updateUserProfileAction.cjs +30 -0
- package/dist/cjs/server/actions/updateUserProfileAction.cjs.map +1 -0
- package/dist/cjs/server/getClient.cjs +19 -0
- package/dist/cjs/server/getClient.cjs.map +1 -0
- package/dist/cjs/server/index.cjs +9 -0
- package/dist/cjs/server/proxy/createRouteMatcher.cjs +36 -0
- package/dist/cjs/server/proxy/createRouteMatcher.cjs.map +1 -0
- package/dist/cjs/server/proxy/thunderIDProxy.cjs +182 -0
- package/dist/cjs/server/proxy/thunderIDProxy.cjs.map +1 -0
- package/dist/cjs/server/thunderid.cjs +27 -0
- package/dist/cjs/server/thunderid.cjs.map +1 -0
- package/dist/cjs/utils/SessionManager.cjs +150 -0
- package/dist/cjs/utils/SessionManager.cjs.map +1 -0
- package/dist/cjs/utils/decorateConfigWithNextEnv.cjs +28 -0
- package/dist/cjs/utils/decorateConfigWithNextEnv.cjs.map +1 -0
- package/dist/cjs/utils/handleRefreshToken.cjs +62 -0
- package/dist/cjs/utils/handleRefreshToken.cjs.map +1 -0
- package/dist/cjs/utils/logger.cjs +11 -0
- package/dist/cjs/utils/logger.cjs.map +1 -0
- package/dist/cjs/utils/sessionUtils.cjs +40 -0
- package/dist/cjs/utils/sessionUtils.cjs.map +1 -0
- package/dist/client/components/actions/SignInButton/SignInButton.d.ts.map +1 -0
- package/dist/client/components/actions/SignInButton/SignInButton.js +73 -0
- package/dist/client/components/actions/SignInButton/SignInButton.js.map +1 -0
- package/dist/client/components/actions/SignOutButton/SignOutButton.d.ts.map +1 -0
- package/dist/client/components/actions/SignOutButton/SignOutButton.js +57 -0
- package/dist/client/components/actions/SignOutButton/SignOutButton.js.map +1 -0
- package/dist/client/components/actions/SignUpButton/SignUpButton.d.ts.map +1 -0
- package/dist/client/components/actions/SignUpButton/SignUpButton.js +85 -0
- package/dist/client/components/actions/SignUpButton/SignUpButton.js.map +1 -0
- package/dist/client/components/control/Loading/Loading.d.ts.map +1 -0
- package/dist/client/components/control/SignedIn/SignedIn.d.ts.map +1 -0
- package/dist/client/components/control/SignedIn/SignedIn.js +32 -0
- package/dist/client/components/control/SignedIn/SignedIn.js.map +1 -0
- package/dist/client/components/control/SignedOut/SignedOut.d.ts.map +1 -0
- package/dist/client/components/control/SignedOut/SignedOut.js +32 -0
- package/dist/client/components/control/SignedOut/SignedOut.js.map +1 -0
- package/dist/client/components/presentation/SignIn/SignIn.d.ts.map +1 -0
- package/dist/client/components/presentation/SignIn/SignIn.js +33 -0
- package/dist/client/components/presentation/SignIn/SignIn.js.map +1 -0
- package/dist/client/components/presentation/SignUp/SignUp.d.ts.map +1 -0
- package/dist/client/components/presentation/SignUp/SignUp.js +75 -0
- package/dist/client/components/presentation/SignUp/SignUp.js.map +1 -0
- package/dist/client/components/presentation/User/User.d.ts.map +1 -0
- package/dist/client/components/presentation/User/User.js +46 -0
- package/dist/client/components/presentation/User/User.js.map +1 -0
- package/dist/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +1 -0
- package/dist/client/components/presentation/UserDropdown/UserDropdown.js +110 -0
- package/dist/client/components/presentation/UserDropdown/UserDropdown.js.map +1 -0
- package/dist/client/components/presentation/UserProfile/UserProfile.d.ts.map +1 -0
- package/dist/client/components/presentation/UserProfile/UserProfile.js +49 -0
- package/dist/client/components/presentation/UserProfile/UserProfile.js.map +1 -0
- package/dist/client/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -0
- package/dist/client/contexts/ThunderID/ThunderIDContext.js +32 -0
- package/dist/client/contexts/ThunderID/ThunderIDContext.js.map +1 -0
- package/dist/{types/client → client}/contexts/ThunderID/ThunderIDProvider.d.ts +1 -8
- package/dist/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -0
- package/dist/client/contexts/ThunderID/ThunderIDProvider.js +159 -0
- package/dist/client/contexts/ThunderID/ThunderIDProvider.js.map +1 -0
- package/dist/client/contexts/ThunderID/useThunderID.d.ts.map +1 -0
- package/dist/client/contexts/ThunderID/useThunderID.js +17 -0
- package/dist/client/contexts/ThunderID/useThunderID.js.map +1 -0
- package/dist/{types/client → client}/index.d.ts +2 -10
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +13 -0
- package/dist/configs/InternalAuthAPIRoutesConfig.d.ts.map +1 -0
- package/dist/constants/sessionConstants.d.ts.map +1 -0
- package/dist/constants/sessionConstants.js +53 -0
- package/dist/constants/sessionConstants.js.map +1 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20 -934
- package/dist/models/api.d.ts.map +1 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/server/ThunderIDProvider.d.ts.map +1 -0
- package/dist/server/ThunderIDProvider.js +111 -0
- package/dist/server/ThunderIDProvider.js.map +1 -0
- package/dist/server/actions/clearSession.d.ts.map +1 -0
- package/dist/server/actions/clearSession.js +39 -0
- package/dist/server/actions/clearSession.js.map +1 -0
- package/dist/server/actions/getAccessToken.d.ts.map +1 -0
- package/dist/{getAccessToken-oRxArjVC.js → server/actions/getAccessToken.js} +8 -5
- package/dist/server/actions/getAccessToken.js.map +1 -0
- package/dist/server/actions/getClientOrigin.d.ts.map +1 -0
- package/dist/server/actions/getClientOrigin.js +16 -0
- package/dist/server/actions/getClientOrigin.js.map +1 -0
- package/dist/server/actions/getSessionId.d.ts.map +1 -0
- package/dist/{getSessionId-_7hj8QSX.js → server/actions/getSessionId.js} +8 -5
- package/dist/server/actions/getSessionId.js.map +1 -0
- package/dist/server/actions/getSessionPayload.d.ts.map +1 -0
- package/dist/server/actions/getSessionPayload.js +27 -0
- package/dist/server/actions/getSessionPayload.js.map +1 -0
- package/dist/server/actions/getUserAction.d.ts.map +1 -0
- package/dist/server/actions/getUserAction.js +30 -0
- package/dist/server/actions/getUserAction.js.map +1 -0
- package/dist/server/actions/getUserProfileAction.d.ts.map +1 -0
- package/dist/server/actions/getUserProfileAction.js +34 -0
- package/dist/server/actions/getUserProfileAction.js.map +1 -0
- package/dist/server/actions/handleOAuthCallbackAction.d.ts.map +1 -0
- package/dist/server/actions/handleOAuthCallbackAction.js +87 -0
- package/dist/server/actions/handleOAuthCallbackAction.js.map +1 -0
- package/dist/server/actions/isSignedIn.d.ts.map +1 -0
- package/dist/server/actions/isSignedIn.js +40 -0
- package/dist/server/actions/isSignedIn.js.map +1 -0
- package/dist/server/actions/refreshToken.d.ts.map +1 -0
- package/dist/server/actions/refreshToken.js +58 -0
- package/dist/server/actions/refreshToken.js.map +1 -0
- package/dist/server/actions/signInAction.d.ts.map +1 -0
- package/dist/server/actions/signInAction.js +92 -0
- package/dist/server/actions/signInAction.js.map +1 -0
- package/dist/server/actions/signOutAction.d.ts.map +1 -0
- package/dist/server/actions/signOutAction.js +55 -0
- package/dist/server/actions/signOutAction.js.map +1 -0
- package/dist/server/actions/signUpAction.d.ts.map +1 -0
- package/dist/server/actions/signUpAction.js +27 -0
- package/dist/server/actions/signUpAction.js.map +1 -0
- package/dist/server/actions/updateUserProfileAction.d.ts.map +1 -0
- package/dist/server/actions/updateUserProfileAction.js +30 -0
- package/dist/server/actions/updateUserProfileAction.js.map +1 -0
- package/dist/server/getClient.d.ts.map +1 -0
- package/dist/server/getClient.js +19 -0
- package/dist/server/getClient.js.map +1 -0
- package/dist/{types/server → server}/index.d.ts +3 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/index.js +6 -0
- package/dist/server/proxy/createRouteMatcher.d.ts.map +1 -0
- package/dist/server/proxy/createRouteMatcher.js +35 -0
- package/dist/server/proxy/createRouteMatcher.js.map +1 -0
- package/dist/{types/server/middleware/thunderIDMiddleware.d.ts → server/proxy/thunderIDProxy.d.ts} +13 -13
- package/dist/server/proxy/thunderIDProxy.d.ts.map +1 -0
- package/dist/server/proxy/thunderIDProxy.js +180 -0
- package/dist/server/proxy/thunderIDProxy.js.map +1 -0
- package/dist/server/thunderid.d.ts.map +1 -0
- package/dist/server/thunderid.js +27 -0
- package/dist/server/thunderid.js.map +1 -0
- package/dist/utils/SessionManager.d.ts.map +1 -0
- package/dist/utils/SessionManager.js +147 -0
- package/dist/utils/SessionManager.js.map +1 -0
- package/dist/utils/createRouteMatcher.d.ts.map +1 -0
- package/dist/utils/decorateConfigWithNextEnv.d.ts.map +1 -0
- package/dist/utils/decorateConfigWithNextEnv.js +27 -0
- package/dist/utils/decorateConfigWithNextEnv.js.map +1 -0
- package/dist/utils/handleRefreshToken.d.ts.map +1 -0
- package/dist/utils/handleRefreshToken.js +62 -0
- package/dist/utils/handleRefreshToken.js.map +1 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +9 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/sessionUtils.d.ts.map +1 -0
- package/dist/utils/sessionUtils.js +39 -0
- package/dist/utils/sessionUtils.js.map +1 -0
- package/package.json +6 -16
- package/dist/SessionManager-BvmZ19QF.js +0 -1384
- package/dist/cache-DOmEIb7_.js +0 -6329
- package/dist/cjs/SessionManager-x03qrCM_.js +0 -1397
- package/dist/cjs/cache-Bw8u7jYk.js +0 -6332
- package/dist/cjs/dynamic-rendering-DY0EUx64.js +0 -1510
- package/dist/cjs/getAccessToken-eJk739AD.js +0 -22
- package/dist/cjs/getSessionId-BXqdO0BZ.js +0 -28
- package/dist/cjs/getSessionId-j-ERy_WP.js +0 -5
- package/dist/cjs/index2.cjs +0 -8
- package/dist/cjs/middleware.cjs +0 -5151
- package/dist/cjs/segment-CViTHaAn.js +0 -52
- package/dist/cjs/server-ABSmm73r.js +0 -2426
- package/dist/dynamic-rendering-CXn-s32e.js +0 -1429
- package/dist/getSessionId-6IipYdCB.js +0 -5
- package/dist/index2.js +0 -7
- package/dist/middleware.js +0 -5152
- package/dist/segment-DRUZ6e3T.js +0 -47
- package/dist/server-BUNp5d6D.js +0 -2376
- package/dist/types/ThunderIDNextClient.d.ts.map +0 -1
- package/dist/types/client/components/actions/SignInButton/SignInButton.d.ts.map +0 -1
- package/dist/types/client/components/actions/SignOutButton/SignOutButton.d.ts.map +0 -1
- package/dist/types/client/components/actions/SignUpButton/SignUpButton.d.ts.map +0 -1
- package/dist/types/client/components/control/Loading/Loading.d.ts.map +0 -1
- package/dist/types/client/components/control/SignedIn/SignedIn.d.ts.map +0 -1
- package/dist/types/client/components/control/SignedOut/SignedOut.d.ts.map +0 -1
- package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts +0 -68
- package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +0 -1
- package/dist/types/client/components/presentation/Organization/Organization.d.ts +0 -67
- package/dist/types/client/components/presentation/Organization/Organization.d.ts.map +0 -1
- package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts +0 -93
- package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts.map +0 -1
- package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +0 -120
- package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +0 -1
- package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +0 -72
- package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +0 -1
- package/dist/types/client/components/presentation/SignIn/SignIn.d.ts.map +0 -1
- package/dist/types/client/components/presentation/SignUp/SignUp.d.ts.map +0 -1
- package/dist/types/client/components/presentation/User/User.d.ts.map +0 -1
- package/dist/types/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +0 -1
- package/dist/types/client/components/presentation/UserProfile/UserProfile.d.ts.map +0 -1
- package/dist/types/client/contexts/ThunderID/ThunderIDContext.d.ts.map +0 -1
- package/dist/types/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +0 -1
- package/dist/types/client/contexts/ThunderID/useThunderID.d.ts.map +0 -1
- package/dist/types/client/index.d.ts.map +0 -1
- package/dist/types/configs/InternalAuthAPIRoutesConfig.d.ts.map +0 -1
- package/dist/types/constants/sessionConstants.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/middleware.d.ts +0 -35
- package/dist/types/middleware.d.ts.map +0 -1
- package/dist/types/models/api.d.ts.map +0 -1
- package/dist/types/models/config.d.ts.map +0 -1
- package/dist/types/server/ThunderIDProvider.d.ts.map +0 -1
- package/dist/types/server/actions/clearSession.d.ts.map +0 -1
- package/dist/types/server/actions/createOrganization.d.ts +0 -24
- package/dist/types/server/actions/createOrganization.d.ts.map +0 -1
- package/dist/types/server/actions/getAccessToken.d.ts.map +0 -1
- package/dist/types/server/actions/getAllOrganizations.d.ts +0 -24
- package/dist/types/server/actions/getAllOrganizations.d.ts.map +0 -1
- package/dist/types/server/actions/getBrandingPreference.d.ts +0 -24
- package/dist/types/server/actions/getBrandingPreference.d.ts.map +0 -1
- package/dist/types/server/actions/getClientOrigin.d.ts.map +0 -1
- package/dist/types/server/actions/getCurrentOrganizationAction.d.ts +0 -31
- package/dist/types/server/actions/getCurrentOrganizationAction.d.ts.map +0 -1
- package/dist/types/server/actions/getMyOrganizations.d.ts +0 -24
- package/dist/types/server/actions/getMyOrganizations.d.ts.map +0 -1
- package/dist/types/server/actions/getOrganizationAction.d.ts +0 -31
- package/dist/types/server/actions/getOrganizationAction.d.ts.map +0 -1
- package/dist/types/server/actions/getSessionId.d.ts.map +0 -1
- package/dist/types/server/actions/getSessionPayload.d.ts.map +0 -1
- package/dist/types/server/actions/getUserAction.d.ts.map +0 -1
- package/dist/types/server/actions/getUserProfileAction.d.ts.map +0 -1
- package/dist/types/server/actions/handleOAuthCallbackAction.d.ts.map +0 -1
- package/dist/types/server/actions/isSignedIn.d.ts.map +0 -1
- package/dist/types/server/actions/refreshToken.d.ts.map +0 -1
- package/dist/types/server/actions/signInAction.d.ts.map +0 -1
- package/dist/types/server/actions/signOutAction.d.ts.map +0 -1
- package/dist/types/server/actions/signUpAction.d.ts.map +0 -1
- package/dist/types/server/actions/switchOrganization.d.ts +0 -24
- package/dist/types/server/actions/switchOrganization.d.ts.map +0 -1
- package/dist/types/server/actions/updateUserProfileAction.d.ts.map +0 -1
- package/dist/types/server/getClient.d.ts.map +0 -1
- package/dist/types/server/index.d.ts.map +0 -1
- package/dist/types/server/middleware/createRouteMatcher.d.ts.map +0 -1
- package/dist/types/server/middleware/thunderIDMiddleware.d.ts.map +0 -1
- package/dist/types/server/thunderid.d.ts.map +0 -1
- package/dist/types/utils/SessionManager.d.ts.map +0 -1
- package/dist/types/utils/createRouteMatcher.d.ts.map +0 -1
- package/dist/types/utils/decorateConfigWithNextEnv.d.ts.map +0 -1
- package/dist/types/utils/handleRefreshToken.d.ts.map +0 -1
- package/dist/types/utils/logger.d.ts.map +0 -1
- package/dist/types/utils/sessionUtils.d.ts.map +0 -1
- /package/dist/{types/client → client}/components/actions/SignInButton/SignInButton.d.ts +0 -0
- /package/dist/{types/client → client}/components/actions/SignOutButton/SignOutButton.d.ts +0 -0
- /package/dist/{types/client → client}/components/actions/SignUpButton/SignUpButton.d.ts +0 -0
- /package/dist/{types/client → client}/components/control/Loading/Loading.d.ts +0 -0
- /package/dist/{types/client → client}/components/control/SignedIn/SignedIn.d.ts +0 -0
- /package/dist/{types/client → client}/components/control/SignedOut/SignedOut.d.ts +0 -0
- /package/dist/{types/client → client}/components/presentation/SignIn/SignIn.d.ts +0 -0
- /package/dist/{types/client → client}/components/presentation/SignUp/SignUp.d.ts +0 -0
- /package/dist/{types/client → client}/components/presentation/User/User.d.ts +0 -0
- /package/dist/{types/client → client}/components/presentation/UserDropdown/UserDropdown.d.ts +0 -0
- /package/dist/{types/client → client}/components/presentation/UserProfile/UserProfile.d.ts +0 -0
- /package/dist/{types/client → client}/contexts/ThunderID/ThunderIDContext.d.ts +0 -0
- /package/dist/{types/client → client}/contexts/ThunderID/useThunderID.d.ts +0 -0
- /package/dist/{types/configs → configs}/InternalAuthAPIRoutesConfig.d.ts +0 -0
- /package/dist/{types/constants → constants}/sessionConstants.d.ts +0 -0
- /package/dist/{types/index.d.ts → index.d.ts} +0 -0
- /package/dist/{types/models → models}/api.d.ts +0 -0
- /package/dist/{types/models → models}/config.d.ts +0 -0
- /package/dist/{types/server → server}/ThunderIDProvider.d.ts +0 -0
- /package/dist/{types/server → server}/actions/clearSession.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getAccessToken.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getClientOrigin.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getSessionId.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getSessionPayload.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getUserAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/getUserProfileAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/handleOAuthCallbackAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/isSignedIn.d.ts +0 -0
- /package/dist/{types/server → server}/actions/refreshToken.d.ts +0 -0
- /package/dist/{types/server → server}/actions/signInAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/signOutAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/signUpAction.d.ts +0 -0
- /package/dist/{types/server → server}/actions/updateUserProfileAction.d.ts +0 -0
- /package/dist/{types/server → server}/getClient.d.ts +0 -0
- /package/dist/{types/server/middleware → server/proxy}/createRouteMatcher.d.ts +0 -0
- /package/dist/{types/server → server}/thunderid.d.ts +0 -0
- /package/dist/{types/utils → utils}/SessionManager.d.ts +0 -0
- /package/dist/{types/utils → utils}/createRouteMatcher.d.ts +0 -0
- /package/dist/{types/utils → utils}/decorateConfigWithNextEnv.d.ts +0 -0
- /package/dist/{types/utils → utils}/handleRefreshToken.d.ts +0 -0
- /package/dist/{types/utils → utils}/logger.d.ts +0 -0
- /package/dist/{types/utils → utils}/sessionUtils.d.ts +0 -0
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_logger = require('../../../utils/logger.cjs');
|
|
6
|
+
const require_ThunderIDContext = require('./ThunderIDContext.cjs');
|
|
7
|
+
let __thunderid_node = require("@thunderid/node");
|
|
8
|
+
__thunderid_node = require_rolldown_runtime.__toESM(__thunderid_node);
|
|
9
|
+
let __thunderid_react = require("@thunderid/react");
|
|
10
|
+
__thunderid_react = require_rolldown_runtime.__toESM(__thunderid_react);
|
|
11
|
+
let next_navigation = require("next/navigation");
|
|
12
|
+
next_navigation = require_rolldown_runtime.__toESM(next_navigation);
|
|
13
|
+
let react = require("react");
|
|
14
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
15
|
+
let react_jsx_runtime = require("react/jsx-runtime");
|
|
16
|
+
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
17
|
+
|
|
18
|
+
//#region src/client/contexts/ThunderID/ThunderIDProvider.tsx
|
|
19
|
+
const ThunderIDClientProvider = ({ baseUrl, children, signIn, clearSession, refreshToken, signOut, signUp, handleOAuthCallback, preferences, isSignedIn, signInUrl, signUpUrl, user: _user, userProfile: _userProfile, updateProfile, applicationId, organizationHandle, scopes }) => {
|
|
20
|
+
const reRenderCheckRef = (0, react.useRef)(false);
|
|
21
|
+
const router = (0, next_navigation.useRouter)();
|
|
22
|
+
const searchParams = (0, next_navigation.useSearchParams)();
|
|
23
|
+
const [isLoading, setIsLoading] = (0, react.useState)(true);
|
|
24
|
+
const [user, setUser] = (0, react.useState)(_user);
|
|
25
|
+
const [userProfile, setUserProfile] = (0, react.useState)(_userProfile);
|
|
26
|
+
(0, react.useEffect)(() => {
|
|
27
|
+
setUserProfile(_userProfile);
|
|
28
|
+
}, [_userProfile]);
|
|
29
|
+
(0, react.useEffect)(() => {
|
|
30
|
+
setUser(_user);
|
|
31
|
+
}, [_user]);
|
|
32
|
+
(0, react.useEffect)(() => {
|
|
33
|
+
if (reRenderCheckRef.current) return;
|
|
34
|
+
reRenderCheckRef.current = true;
|
|
35
|
+
if (isSignedIn) return;
|
|
36
|
+
(async () => {
|
|
37
|
+
try {
|
|
38
|
+
const code = searchParams.get("code");
|
|
39
|
+
const state = searchParams.get("state");
|
|
40
|
+
const sessionState = searchParams.get("session_state");
|
|
41
|
+
if (searchParams.get("error")) {
|
|
42
|
+
require_logger.default.error("[ThunderIDClientProvider] An error was received for the initiated sign-in request.");
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
if (code && state) {
|
|
46
|
+
setIsLoading(true);
|
|
47
|
+
const result = await handleOAuthCallback(code, state, sessionState || void 0);
|
|
48
|
+
if (result.success) if (result.redirectUrl) router.push(result.redirectUrl);
|
|
49
|
+
else window.location.reload();
|
|
50
|
+
else require_logger.default.error(`[ThunderIDClientProvider] An error occurred while signing in: ${result.error || "Authentication failed"}`);
|
|
51
|
+
}
|
|
52
|
+
} catch (error) {
|
|
53
|
+
require_logger.default.error("[ThunderIDClientProvider] Failed to handle OAuth callback:", error);
|
|
54
|
+
}
|
|
55
|
+
})();
|
|
56
|
+
}, []);
|
|
57
|
+
(0, react.useEffect)(() => {
|
|
58
|
+
setIsLoading(false);
|
|
59
|
+
}, [isSignedIn, user]);
|
|
60
|
+
const handleSignIn = async (payload, request) => {
|
|
61
|
+
if (!signIn) throw new __thunderid_node.ThunderIDRuntimeError("`signIn` function is not available.", "ThunderIDClientProvider-handleSignIn-RuntimeError-001", "nextjs");
|
|
62
|
+
const result = await signIn(payload, request);
|
|
63
|
+
if (result?.data?.signInUrl) {
|
|
64
|
+
window.location.href = result.data.signInUrl;
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
if (result?.data?.afterSignInUrl) {
|
|
68
|
+
router.push(result.data.afterSignInUrl);
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
if (result?.error) throw new Error(result.error);
|
|
72
|
+
return result?.data ?? result;
|
|
73
|
+
};
|
|
74
|
+
const handleSignUp = async (payload, request) => {
|
|
75
|
+
if (!signUp) throw new __thunderid_node.ThunderIDRuntimeError("`signUp` function is not available.", "ThunderIDClientProvider-handleSignUp-RuntimeError-001", "nextjs");
|
|
76
|
+
const result = await signUp(payload, request);
|
|
77
|
+
if (result?.data?.signUpUrl) {
|
|
78
|
+
router.push(result.data.signUpUrl);
|
|
79
|
+
return;
|
|
80
|
+
}
|
|
81
|
+
if (result?.data?.afterSignUpUrl) {
|
|
82
|
+
router.push(result.data.afterSignUpUrl);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
if (result?.error) throw new Error(result.error);
|
|
86
|
+
return result?.data ?? result;
|
|
87
|
+
};
|
|
88
|
+
const handleSignOut = async () => {
|
|
89
|
+
require_logger.default.debug("[ThunderIDClientProvider][handleSignOut] `handleSignOut` called.");
|
|
90
|
+
try {
|
|
91
|
+
const result = await signOut();
|
|
92
|
+
require_logger.default.debug("[ThunderIDClientProvider][handleSignOut] Sign out result:", result);
|
|
93
|
+
if (result?.data?.afterSignOutUrl) {
|
|
94
|
+
router.push(result.data.afterSignOutUrl);
|
|
95
|
+
return {
|
|
96
|
+
location: result.data.afterSignOutUrl,
|
|
97
|
+
redirected: true
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
if (result?.error) require_logger.default.error("[ThunderIDClientProvider][handleSignOut] Error result was returned during signing the user out with a button click:", result.error);
|
|
101
|
+
return result?.data ?? result;
|
|
102
|
+
} catch (error) {
|
|
103
|
+
require_logger.default.error("[ThunderIDClientProvider][handleSignOut] Error occurred during signing the user out with a button click:", error);
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
106
|
+
};
|
|
107
|
+
const contextValue = (0, react.useMemo)(() => ({
|
|
108
|
+
applicationId,
|
|
109
|
+
baseUrl,
|
|
110
|
+
clearSession,
|
|
111
|
+
isLoading,
|
|
112
|
+
isSignedIn,
|
|
113
|
+
organizationHandle,
|
|
114
|
+
refreshToken,
|
|
115
|
+
scopes,
|
|
116
|
+
signIn: handleSignIn,
|
|
117
|
+
signInUrl,
|
|
118
|
+
signOut: handleSignOut,
|
|
119
|
+
signUp: handleSignUp,
|
|
120
|
+
signUpUrl,
|
|
121
|
+
user
|
|
122
|
+
}), [
|
|
123
|
+
baseUrl,
|
|
124
|
+
user,
|
|
125
|
+
isSignedIn,
|
|
126
|
+
isLoading,
|
|
127
|
+
signInUrl,
|
|
128
|
+
signUpUrl,
|
|
129
|
+
applicationId,
|
|
130
|
+
organizationHandle,
|
|
131
|
+
scopes
|
|
132
|
+
]);
|
|
133
|
+
const handleProfileUpdate = (payload) => {
|
|
134
|
+
setUser(payload);
|
|
135
|
+
setUserProfile((prev) => ({
|
|
136
|
+
...prev,
|
|
137
|
+
flattenedProfile: (0, __thunderid_node.generateFlattenedUserProfile)(payload, prev?.schemas),
|
|
138
|
+
profile: payload
|
|
139
|
+
}));
|
|
140
|
+
};
|
|
141
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_ThunderIDContext.default.Provider, {
|
|
142
|
+
value: contextValue,
|
|
143
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.I18nProvider, {
|
|
144
|
+
preferences: preferences?.i18n,
|
|
145
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.FlowMetaProvider, {
|
|
146
|
+
enabled: preferences?.resolveFromMeta !== false,
|
|
147
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.ThemeProvider, {
|
|
148
|
+
theme: preferences?.theme?.overrides,
|
|
149
|
+
mode: (0, __thunderid_react.getActiveTheme)(preferences?.theme?.mode),
|
|
150
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.FlowProvider, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__thunderid_react.UserProvider, {
|
|
151
|
+
profile: userProfile,
|
|
152
|
+
onUpdateProfile: handleProfileUpdate,
|
|
153
|
+
updateProfile,
|
|
154
|
+
children
|
|
155
|
+
}) })
|
|
156
|
+
})
|
|
157
|
+
})
|
|
158
|
+
})
|
|
159
|
+
});
|
|
160
|
+
};
|
|
161
|
+
var ThunderIDProvider_default = ThunderIDClientProvider;
|
|
162
|
+
|
|
163
|
+
//#endregion
|
|
164
|
+
exports.default = ThunderIDProvider_default;
|
|
165
|
+
//# sourceMappingURL=ThunderIDProvider.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThunderIDProvider.cjs","names":["ThunderIDClientProvider: FC<PropsWithChildren<ThunderIDClientProviderProps>>","reRenderCheckRef: RefObject<boolean>","router: AppRouterInstance","searchParams: ReadonlyURLSearchParams","code: string | null","state: string | null","sessionState: string | null","result: {error?: string; redirectUrl?: string; success: boolean}","ThunderIDRuntimeError","result: any","contextValue: ThunderIDContextProps","ThunderIDContext","I18nProvider","FlowMetaProvider","ThemeProvider","FlowProvider","UserProvider"],"sources":["../../../../../src/client/contexts/ThunderID/ThunderIDProvider.tsx"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {\n EmbeddedFlowExecuteRequestConfig,\n generateFlattenedUserProfile,\n UpdateMeProfileConfig,\n User,\n UserProfile,\n ThunderIDRuntimeError,\n} from '@thunderid/node';\nimport {\n I18nProvider,\n FlowMetaProvider,\n FlowProvider,\n UserProvider,\n ThemeProvider,\n ThunderIDProviderProps,\n getActiveTheme,\n} from '@thunderid/react';\nimport {ReadonlyURLSearchParams} from 'next/dist/client/components/navigation.react-server';\nimport {AppRouterInstance} from 'next/dist/shared/lib/app-router-context.shared-runtime';\nimport {useRouter, useSearchParams} from 'next/navigation';\nimport {FC, PropsWithChildren, RefObject, useEffect, useMemo, useRef, useState} from 'react';\nimport ThunderIDContext, {ThunderIDContextProps} from './ThunderIDContext';\nimport {RefreshResult} from '../../../server/actions/refreshToken';\nimport logger from '../../../utils/logger';\n\n/**\n * Props interface of {@link ThunderIDClientProvider}\n */\nexport type ThunderIDClientProviderProps = Partial<Omit<ThunderIDProviderProps, 'baseUrl' | 'clientId'>> &\n Pick<ThunderIDProviderProps, 'baseUrl' | 'clientId'> & {\n applicationId: ThunderIDContextProps['applicationId'];\n clearSession: () => Promise<void>;\n handleOAuthCallback: (\n code: string,\n state: string,\n sessionState?: string,\n ) => Promise<{error?: string; redirectUrl?: string; success: boolean}>;\n isSignedIn: boolean;\n organizationHandle: ThunderIDContextProps['organizationHandle'];\n refreshToken: () => Promise<RefreshResult>;\n signIn: ThunderIDContextProps['signIn'];\n signOut: ThunderIDContextProps['signOut'];\n signUp: ThunderIDContextProps['signUp'];\n updateProfile: (\n requestConfig: UpdateMeProfileConfig,\n sessionId?: string,\n ) => Promise<{data: {user: User}; error: string; success: boolean}>;\n user: User | null;\n userProfile: UserProfile;\n };\n\nconst ThunderIDClientProvider: FC<PropsWithChildren<ThunderIDClientProviderProps>> = ({\n baseUrl,\n children,\n signIn,\n clearSession,\n refreshToken,\n signOut,\n signUp,\n handleOAuthCallback,\n preferences,\n isSignedIn,\n signInUrl,\n signUpUrl,\n user: _user,\n userProfile: _userProfile,\n updateProfile,\n applicationId,\n organizationHandle,\n scopes,\n}: PropsWithChildren<ThunderIDClientProviderProps>) => {\n const reRenderCheckRef: RefObject<boolean> = useRef(false);\n const router: AppRouterInstance = useRouter();\n const searchParams: ReadonlyURLSearchParams = useSearchParams();\n const [isLoading, setIsLoading] = useState<boolean>(true);\n const [user, setUser] = useState<User | null>(_user);\n const [userProfile, setUserProfile] = useState<UserProfile>(_userProfile);\n\n useEffect(() => {\n setUserProfile(_userProfile);\n }, [_userProfile]);\n\n useEffect(() => {\n setUser(_user);\n }, [_user]);\n\n // Handle OAuth callback automatically\n useEffect(() => {\n // React 18.x Strict.Mode has a new check for `Ensuring reusable state` to facilitate an upcoming react feature.\n // https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state\n // This will remount all the useEffects to ensure that there are no unexpected side effects.\n // When react remounts the signIn hook of the AuthProvider, it will cause a race condition. Hence, we have to\n // prevent the re-render of this hook as suggested in the following discussion.\n // https://github.com/reactwg/react-18/discussions/18#discussioncomment-795623\n if (reRenderCheckRef.current) {\n return;\n }\n\n reRenderCheckRef.current = true;\n\n // Don't handle callback if already signed in\n if (isSignedIn) return;\n\n (async (): Promise<void> => {\n try {\n const code: string | null = searchParams.get('code');\n const state: string | null = searchParams.get('state');\n const sessionState: string | null = searchParams.get('session_state');\n const error: string | null = searchParams.get('error');\n\n // Check for OAuth errors first\n if (error) {\n logger.error('[ThunderIDClientProvider] An error was received for the initiated sign-in request.');\n\n return;\n }\n\n // Handle OAuth callback if code and state are present\n if (code && state) {\n setIsLoading(true);\n\n const result: {error?: string; redirectUrl?: string; success: boolean} = await handleOAuthCallback(\n code,\n state,\n sessionState || undefined,\n );\n\n if (result.success) {\n // Redirect to the success URL\n if (result.redirectUrl) {\n router.push(result.redirectUrl);\n } else {\n // Refresh the page to update authentication state\n window.location.reload();\n }\n } else {\n logger.error(\n `[ThunderIDClientProvider] An error occurred while signing in: ${result.error || 'Authentication failed'}`,\n );\n }\n }\n } catch (error) {\n logger.error('[ThunderIDClientProvider] Failed to handle OAuth callback:', error);\n }\n })();\n }, []);\n\n useEffect(() => {\n // Set loading to false when server has resolved authentication state\n setIsLoading(false);\n }, [isSignedIn, user]);\n\n const handleSignIn = async (payload: any, request: EmbeddedFlowExecuteRequestConfig): Promise<any> => {\n if (!signIn) {\n throw new ThunderIDRuntimeError(\n '`signIn` function is not available.',\n 'ThunderIDClientProvider-handleSignIn-RuntimeError-001',\n 'nextjs',\n );\n }\n\n const result: any = await signIn(payload, request);\n\n // Redirect based flow URL is sent as `signInUrl` in the response.\n // Use window.location.href instead of router.push() — the OAuth authorization\n // endpoint is on an external server, and router.push() would send RSC fetch\n // headers that the identity provider doesn't understand, causing a CORS error.\n if (result?.data?.signInUrl) {\n window.location.href = result.data.signInUrl;\n\n return undefined;\n }\n\n // After the Embedded flow is successful, the URL to navigate next is sent as `afterSignInUrl` in the response.\n if (result?.data?.afterSignInUrl) {\n router.push(result.data.afterSignInUrl);\n\n return undefined;\n }\n\n if (result?.error) {\n throw new Error(result.error);\n }\n\n return result?.data ?? result;\n };\n\n const handleSignUp = async (payload: any, request: EmbeddedFlowExecuteRequestConfig): Promise<any> => {\n if (!signUp) {\n throw new ThunderIDRuntimeError(\n '`signUp` function is not available.',\n 'ThunderIDClientProvider-handleSignUp-RuntimeError-001',\n 'nextjs',\n );\n }\n\n const result: any = await signUp(payload, request);\n\n // Redirect based flow URL is sent as `signUpUrl` in the response.\n if (result?.data?.signUpUrl) {\n router.push(result.data.signUpUrl);\n\n return undefined;\n }\n\n // After the Embedded flow is successful, the URL to navigate next is sent as `afterSignUpUrl` in the response.\n if (result?.data?.afterSignUpUrl) {\n router.push(result.data.afterSignUpUrl);\n\n return undefined;\n }\n\n if (result?.error) {\n throw new Error(result.error);\n }\n\n return result?.data ?? result;\n };\n\n const handleSignOut = async (): Promise<any> => {\n logger.debug('[ThunderIDClientProvider][handleSignOut] `handleSignOut` called.');\n\n try {\n const result: any = await signOut();\n\n logger.debug('[ThunderIDClientProvider][handleSignOut] Sign out result:', result);\n\n if (result?.data?.afterSignOutUrl) {\n router.push(result.data.afterSignOutUrl);\n\n return {location: result.data.afterSignOutUrl, redirected: true};\n }\n\n if (result?.error) {\n logger.error(\n '[ThunderIDClientProvider][handleSignOut] Error result was returned during signing the user out with a button click:',\n result.error,\n );\n }\n\n return result?.data ?? result;\n } catch (error) {\n logger.error(\n '[ThunderIDClientProvider][handleSignOut] Error occurred during signing the user out with a button click:',\n error,\n );\n\n return undefined;\n }\n };\n\n const contextValue: ThunderIDContextProps = useMemo(\n () => ({\n applicationId,\n baseUrl,\n clearSession,\n isLoading,\n isSignedIn,\n organizationHandle,\n refreshToken,\n scopes,\n signIn: handleSignIn,\n signInUrl,\n signOut: handleSignOut,\n signUp: handleSignUp,\n signUpUrl,\n user,\n }),\n [baseUrl, user, isSignedIn, isLoading, signInUrl, signUpUrl, applicationId, organizationHandle, scopes],\n );\n\n const handleProfileUpdate = (payload: User): void => {\n setUser(payload);\n setUserProfile((prev: UserProfile) => ({\n ...prev,\n flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),\n profile: payload,\n }));\n };\n\n return (\n <ThunderIDContext.Provider value={contextValue}>\n <I18nProvider preferences={preferences?.i18n}>\n <FlowMetaProvider enabled={preferences?.resolveFromMeta !== false}>\n <ThemeProvider theme={preferences?.theme?.overrides} mode={getActiveTheme(preferences?.theme?.mode as any)}>\n <FlowProvider>\n <UserProvider profile={userProfile} onUpdateProfile={handleProfileUpdate} updateProfile={updateProfile}>\n {children}\n </UserProvider>\n </FlowProvider>\n </ThemeProvider>\n </FlowMetaProvider>\n </I18nProvider>\n </ThunderIDContext.Provider>\n );\n};\n\nexport default ThunderIDClientProvider;\n"],"mappings":"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"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
5
|
+
const require_ThunderIDContext = require('./ThunderIDContext.cjs');
|
|
6
|
+
let react = require("react");
|
|
7
|
+
react = require_rolldown_runtime.__toESM(react);
|
|
8
|
+
|
|
9
|
+
//#region src/client/contexts/ThunderID/useThunderID.ts
|
|
10
|
+
const useThunderID = () => {
|
|
11
|
+
const context = (0, react.useContext)(require_ThunderIDContext.default);
|
|
12
|
+
if (!context) throw new Error("useThunderID must be used within an ThunderIDProvider");
|
|
13
|
+
return context;
|
|
14
|
+
};
|
|
15
|
+
var useThunderID_default = useThunderID;
|
|
16
|
+
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.default = useThunderID_default;
|
|
19
|
+
//# sourceMappingURL=useThunderID.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThunderID.cjs","names":["context: ThunderIDContextProps | null","ThunderIDContext"],"sources":["../../../../../src/client/contexts/ThunderID/useThunderID.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n'use client';\n\nimport {useContext} from 'react';\nimport ThunderIDContext, {ThunderIDContextProps} from './ThunderIDContext';\n\nconst useThunderID = (): ThunderIDContextProps => {\n const context: ThunderIDContextProps | null = useContext(ThunderIDContext);\n\n if (!context) {\n throw new Error('useThunderID must be used within an ThunderIDProvider');\n }\n\n return context;\n};\n\nexport default useThunderID;\n"],"mappings":";;;;;;;;;AAuBA,MAAM,qBAA4C;CAChD,MAAMA,gCAAmDC,iCAAiB;AAE1E,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wDAAwD;AAG1E,QAAO;;AAGT,2BAAe"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
const require_useThunderID = require('./contexts/ThunderID/useThunderID.cjs');
|
|
2
|
+
const require_SignedIn = require('./components/control/SignedIn/SignedIn.cjs');
|
|
3
|
+
const require_SignedOut = require('./components/control/SignedOut/SignedOut.cjs');
|
|
4
|
+
const require_SignInButton = require('./components/actions/SignInButton/SignInButton.cjs');
|
|
5
|
+
const require_SignUpButton = require('./components/actions/SignUpButton/SignUpButton.cjs');
|
|
6
|
+
const require_SignIn = require('./components/presentation/SignIn/SignIn.cjs');
|
|
7
|
+
const require_SignOutButton = require('./components/actions/SignOutButton/SignOutButton.cjs');
|
|
8
|
+
const require_User = require('./components/presentation/User/User.cjs');
|
|
9
|
+
const require_SignUp = require('./components/presentation/SignUp/SignUp.cjs');
|
|
10
|
+
const require_UserProfile = require('./components/presentation/UserProfile/UserProfile.cjs');
|
|
11
|
+
const require_UserDropdown = require('./components/presentation/UserDropdown/UserDropdown.cjs');
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
|
|
2
|
+
//#region src/constants/sessionConstants.ts
|
|
3
|
+
/**
|
|
4
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
5
|
+
*
|
|
6
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
7
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
8
|
+
* in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing,
|
|
14
|
+
* software distributed under the License is distributed on an
|
|
15
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
16
|
+
* KIND, either express or implied. See the License for the
|
|
17
|
+
* specific language governing permissions and limitations
|
|
18
|
+
* under the License.
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Number of seconds before access token expiry at which the SDK proactively
|
|
22
|
+
* refreshes the token. A 25-second buffer prevents races where the token is
|
|
23
|
+
* valid when a request starts but expires mid-flight.
|
|
24
|
+
*/
|
|
25
|
+
const REFRESH_BUFFER_SECONDS = 25;
|
|
26
|
+
/**
|
|
27
|
+
* Default session cookie lifetime in seconds (24 hours).
|
|
28
|
+
*
|
|
29
|
+
* Used when no explicit session cookie expiry is configured. The session cookie
|
|
30
|
+
* lifetime can be overridden in two ways (evaluated in this order):
|
|
31
|
+
*
|
|
32
|
+
* 1. `sessionCookie.expiryTime` in `ThunderIDNodeConfig` — set programmatically
|
|
33
|
+
* when initialising the SDK.
|
|
34
|
+
* 2. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable — set in `.env`
|
|
35
|
+
* (e.g. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME=86400`).
|
|
36
|
+
* 3. This constant — applied when neither of the above is present.
|
|
37
|
+
*
|
|
38
|
+
* Two independent expiry bounds apply to the session and they are generally
|
|
39
|
+
* NOT the same value:
|
|
40
|
+
*
|
|
41
|
+
* - JWT `exp` claim — set by `SessionManager.createSessionToken(...)` from
|
|
42
|
+
* the `accessTokenTtlSeconds` argument (i.e. the access token's `expires_in`
|
|
43
|
+
* returned by the auth server, typically ~1 hour). This controls when
|
|
44
|
+
* `verifySessionToken` rejects the token and is the trigger for a refresh.
|
|
45
|
+
* - Browser cookie `maxAge` — set by the caller (sign-in / refresh / org-switch
|
|
46
|
+
* actions) from `SessionManager.resolveSessionCookieExpiry(...)`, which returns
|
|
47
|
+
* this constant by default (24 hours). This controls how long the browser
|
|
48
|
+
* holds the cookie before discarding it.
|
|
49
|
+
*/
|
|
50
|
+
const DEFAULT_SESSION_COOKIE_EXPIRY_TIME = 86400;
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
exports.DEFAULT_SESSION_COOKIE_EXPIRY_TIME = DEFAULT_SESSION_COOKIE_EXPIRY_TIME;
|
|
54
|
+
exports.REFRESH_BUFFER_SECONDS = REFRESH_BUFFER_SECONDS;
|
|
55
|
+
//# sourceMappingURL=sessionConstants.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sessionConstants.cjs","names":[],"sources":["../../../src/constants/sessionConstants.ts"],"sourcesContent":["/**\n * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).\n *\n * WSO2 LLC. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\n/**\n * Number of seconds before access token expiry at which the SDK proactively\n * refreshes the token. A 25-second buffer prevents races where the token is\n * valid when a request starts but expires mid-flight.\n */\nexport const REFRESH_BUFFER_SECONDS = 25;\n\n/**\n * Default session cookie lifetime in seconds (24 hours).\n *\n * Used when no explicit session cookie expiry is configured. The session cookie\n * lifetime can be overridden in two ways (evaluated in this order):\n *\n * 1. `sessionCookie.expiryTime` in `ThunderIDNodeConfig` — set programmatically\n * when initialising the SDK.\n * 2. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable — set in `.env`\n * (e.g. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME=86400`).\n * 3. This constant — applied when neither of the above is present.\n *\n * Two independent expiry bounds apply to the session and they are generally\n * NOT the same value:\n *\n * - JWT `exp` claim — set by `SessionManager.createSessionToken(...)` from\n * the `accessTokenTtlSeconds` argument (i.e. the access token's `expires_in`\n * returned by the auth server, typically ~1 hour). This controls when\n * `verifySessionToken` rejects the token and is the trigger for a refresh.\n * - Browser cookie `maxAge` — set by the caller (sign-in / refresh / org-switch\n * actions) from `SessionManager.resolveSessionCookieExpiry(...)`, which returns\n * this constant by default (24 hours). This controls how long the browser\n * holds the cookie before discarding it.\n */\nexport const DEFAULT_SESSION_COOKIE_EXPIRY_TIME = 86400;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAuBA,MAAa,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;AA0BtC,MAAa,qCAAqC"}
|