@thunderid/nextjs 0.2.0 → 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} +2 -9
- 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 -1037
- 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/{types/client → client}/components/presentation/SignIn/SignIn.d.ts +0 -38
- 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 -981
- 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-DCP_zasP.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-Ctmvpfgp.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/{types/server → server}/actions/signInAction.d.ts +3 -3
- 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/{types/server/actions/getMyOrganizations.d.ts → server/actions/signUpAction.d.ts} +10 -5
- 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 +12 -22
- package/dist/SessionManager-BPpyyzfa.js +0 -1384
- package/dist/cache-B9tFVOO5.js +0 -8047
- package/dist/cjs/SessionManager-SBxwYnwV.js +0 -1397
- package/dist/cjs/cache-0QwhuLuy.js +0 -8050
- package/dist/cjs/dynamic-rendering-W7rdgerZ.js +0 -1540
- package/dist/cjs/getAccessToken-EiHUciAb.js +0 -22
- package/dist/cjs/getSessionId-BUDHvxX2.js +0 -5
- package/dist/cjs/getSessionId-Do242Vmz.js +0 -28
- package/dist/cjs/index2.cjs +0 -8
- package/dist/cjs/middleware.cjs +0 -5151
- package/dist/cjs/segment-CPZPzHDj.js +0 -52
- package/dist/cjs/server-BAGHs6kk.js +0 -2468
- package/dist/dynamic-rendering-CkPpk5pF.js +0 -1441
- package/dist/getSessionId-pG-rZbaH.js +0 -5
- package/dist/index2.js +0 -7
- package/dist/middleware.js +0 -5152
- package/dist/segment-D3vdYYI5.js +0 -47
- package/dist/server-Bn2BrWaL.js +0 -2418
- 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.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 +0 -36
- 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/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/signOutAction.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 @@
|
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/models/api.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;GAGG;AACH,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/models/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,mBAAmB,EAAC,MAAM,iBAAiB,CAAC;AAEpD;;;;;;;;;;GAUG;AACH,MAAM,MAAM,mBAAmB,GAAG,mBAAmB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThunderIDProvider.d.ts","sourceRoot":"","sources":["../../src/server/ThunderIDProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAO,EAAC,sBAAsB,EAAC,MAAM,kBAAkB,CAAC;AACxD,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAAe,MAAM,OAAO,CAAC;AAmB1D;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAAC,sBAAsB,CAAC,GAAG;IAC3E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;;;;;OAYG;IACH,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,uBAAuB,EAAE,EAAE,CAAC,iBAAiB,CAAC,4BAA4B,CAAC,CA0GhF,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import getSessionId_default from "./actions/getSessionId.js";
|
|
5
|
+
import getClient_default from "./getClient.js";
|
|
6
|
+
import logger_default from "../utils/logger.js";
|
|
7
|
+
import clearSession_default from "./actions/clearSession.js";
|
|
8
|
+
import getSessionPayload_default from "./actions/getSessionPayload.js";
|
|
9
|
+
import getUserAction_default from "./actions/getUserAction.js";
|
|
10
|
+
import getUserProfileAction_default from "./actions/getUserProfileAction.js";
|
|
11
|
+
import handleOAuthCallbackAction_default from "./actions/handleOAuthCallbackAction.js";
|
|
12
|
+
import isSignedIn_default from "./actions/isSignedIn.js";
|
|
13
|
+
import refreshToken_default from "./actions/refreshToken.js";
|
|
14
|
+
import signInAction_default from "./actions/signInAction.js";
|
|
15
|
+
import signOutAction_default from "./actions/signOutAction.js";
|
|
16
|
+
import signUpAction_default from "./actions/signUpAction.js";
|
|
17
|
+
import updateUserProfileAction_default from "./actions/updateUserProfileAction.js";
|
|
18
|
+
import ThunderIDProvider_default from "../client/contexts/ThunderID/ThunderIDProvider.js";
|
|
19
|
+
import { ThunderIDRuntimeError } from "@thunderid/node";
|
|
20
|
+
import { Fragment, jsx } from "react/jsx-runtime";
|
|
21
|
+
|
|
22
|
+
//#region src/server/ThunderIDProvider.tsx
|
|
23
|
+
/**
|
|
24
|
+
* Server-side provider component for ThunderID authentication.
|
|
25
|
+
* Wraps the client-side provider and handles server-side authentication logic.
|
|
26
|
+
* Uses the singleton ThunderIDNextClient instance for consistent authentication state.
|
|
27
|
+
*
|
|
28
|
+
* @param props - Props injected into the component.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <ThunderIDServerProvider config={thunderidConfig}>
|
|
33
|
+
* <YourApp />
|
|
34
|
+
* </ThunderIDServerProvider>
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @returns ThunderIDServerProvider component.
|
|
38
|
+
*/
|
|
39
|
+
const ThunderIDServerProvider = async ({ children, afterSignInUrl, afterSignOutUrl,..._config }) => {
|
|
40
|
+
const thunderIDClient = getClient_default();
|
|
41
|
+
let config = {};
|
|
42
|
+
try {
|
|
43
|
+
await thunderIDClient.initialize(_config);
|
|
44
|
+
logger_default.debug("[ThunderIDServerProvider] ThunderID client initialized successfully.");
|
|
45
|
+
config = await thunderIDClient.getConfiguration();
|
|
46
|
+
} catch (error) {
|
|
47
|
+
logger_default.error("[ThunderIDServerProvider] Failed to initialize ThunderID client:", error?.toString());
|
|
48
|
+
throw new ThunderIDRuntimeError(`Failed to initialize ThunderID client: ${error?.toString()}`, "next-ConfigurationError-001", "next", "An error occurred while initializing the ThunderID client. Please check your configuration.");
|
|
49
|
+
}
|
|
50
|
+
if (!thunderIDClient.isInitialized) return /* @__PURE__ */ jsx(Fragment, {});
|
|
51
|
+
const sessionPayload = await getSessionPayload_default();
|
|
52
|
+
const sessionId = sessionPayload?.sessionId || await getSessionId_default() || "";
|
|
53
|
+
const signedIn = await isSignedIn_default(sessionId);
|
|
54
|
+
let user = {};
|
|
55
|
+
let userProfile = {
|
|
56
|
+
flattenedProfile: {},
|
|
57
|
+
profile: {},
|
|
58
|
+
schemas: []
|
|
59
|
+
};
|
|
60
|
+
if (signedIn) {
|
|
61
|
+
let updatedBaseUrl = config?.baseUrl;
|
|
62
|
+
if (sessionPayload?.organizationId) {
|
|
63
|
+
updatedBaseUrl = `${config?.baseUrl}/o`;
|
|
64
|
+
config = {
|
|
65
|
+
...config,
|
|
66
|
+
baseUrl: updatedBaseUrl
|
|
67
|
+
};
|
|
68
|
+
} else if (sessionId) try {
|
|
69
|
+
if ((await thunderIDClient.getDecodedIdToken(sessionId))?.["user_org"]) {
|
|
70
|
+
updatedBaseUrl = `${config?.baseUrl}/o`;
|
|
71
|
+
config = {
|
|
72
|
+
...config,
|
|
73
|
+
baseUrl: updatedBaseUrl
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
} catch {}
|
|
77
|
+
if (config?.preferences?.user?.fetchUserProfile !== false) try {
|
|
78
|
+
const userResponse = await getUserAction_default(sessionId);
|
|
79
|
+
const userProfileResponse = await getUserProfileAction_default(sessionId);
|
|
80
|
+
user = userResponse.data?.user || {};
|
|
81
|
+
userProfile = userProfileResponse.data?.userProfile ?? userProfile;
|
|
82
|
+
} catch (error) {
|
|
83
|
+
logger_default.warn("[ThunderIDServerProvider] Failed to fetch user profile from SCIM2:", error?.toString());
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return /* @__PURE__ */ jsx(ThunderIDProvider_default, {
|
|
87
|
+
organizationHandle: config?.organizationHandle,
|
|
88
|
+
applicationId: config?.applicationId,
|
|
89
|
+
baseUrl: config?.baseUrl,
|
|
90
|
+
signIn: signInAction_default,
|
|
91
|
+
clearSession: clearSession_default,
|
|
92
|
+
refreshToken: refreshToken_default,
|
|
93
|
+
signOut: signOutAction_default,
|
|
94
|
+
signUp: signUpAction_default,
|
|
95
|
+
handleOAuthCallback: handleOAuthCallbackAction_default,
|
|
96
|
+
signInUrl: config?.signInUrl,
|
|
97
|
+
signUpUrl: config?.signUpUrl,
|
|
98
|
+
preferences: config?.preferences,
|
|
99
|
+
clientId: config?.clientId,
|
|
100
|
+
user,
|
|
101
|
+
userProfile,
|
|
102
|
+
updateProfile: updateUserProfileAction_default,
|
|
103
|
+
isSignedIn: signedIn,
|
|
104
|
+
children
|
|
105
|
+
});
|
|
106
|
+
};
|
|
107
|
+
var ThunderIDProvider_default$1 = ThunderIDServerProvider;
|
|
108
|
+
|
|
109
|
+
//#endregion
|
|
110
|
+
export { ThunderIDProvider_default$1 as default };
|
|
111
|
+
//# sourceMappingURL=ThunderIDProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThunderIDProvider.js","names":["ThunderIDServerProvider: FC<PropsWithChildren<ThunderIDServerProviderProps>>","getClient","config: Partial<ThunderIDNextConfig>","sessionPayload: SessionTokenPayload | undefined","getSessionPayload","sessionId: string","getSessionId","signedIn: boolean","isSignedIn","user: User","userProfile: UserProfile","updatedBaseUrl: string | undefined","userResponse: {\n data: {user: User | null};\n error: string | null;\n success: boolean;\n }","getUserAction","userProfileResponse: {\n data: {userProfile: UserProfile};\n error: string | null;\n success: boolean;\n }","getUserProfileAction","ThunderIDClientProvider","signInAction","clearSession","refreshToken","signOutAction","signUpAction","handleOAuthCallbackAction","updateUserProfileAction"],"sources":["../../src/server/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 server';\n\nimport {ThunderIDRuntimeError, IdToken, User, UserProfile} from '@thunderid/node';\nimport {ThunderIDProviderProps} from '@thunderid/react';\nimport {FC, PropsWithChildren, ReactElement} from 'react';\nimport clearSession from './actions/clearSession';\nimport getSessionId from './actions/getSessionId';\nimport getSessionPayload from './actions/getSessionPayload';\nimport getUserAction from './actions/getUserAction';\nimport getUserProfileAction from './actions/getUserProfileAction';\nimport handleOAuthCallbackAction from './actions/handleOAuthCallbackAction';\nimport isSignedIn from './actions/isSignedIn';\nimport refreshToken from './actions/refreshToken';\nimport signInAction from './actions/signInAction';\nimport signOutAction from './actions/signOutAction';\nimport signUpAction from './actions/signUpAction';\nimport updateUserProfileAction from './actions/updateUserProfileAction';\nimport getClient from './getClient';\nimport ThunderIDClientProvider from '../client/contexts/ThunderID/ThunderIDProvider.js';\nimport {ThunderIDNextConfig} from '../models/config';\nimport logger from '../utils/logger';\nimport {SessionTokenPayload} from '../utils/SessionManager';\n\n/**\n * Props interface of {@link ThunderIDServerProvider}\n */\nexport type ThunderIDServerProviderProps = Partial<ThunderIDProviderProps> & {\n clientSecret?: string;\n /**\n * Session cookie lifetime in seconds. Determines how long the session cookie\n * remains valid in the browser after sign-in.\n *\n * Resolution order (first defined value wins):\n * 1. This prop — set here when mounting the provider.\n * 2. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable.\n * 3. Built-in default of 86400 seconds (24 hours).\n *\n * @example\n * // 8-hour session cookie\n * <ThunderIDServerProvider sessionCookieExpiryTime={28800} ... />\n */\n sessionCookieExpiryTime?: number;\n};\n\n/**\n * Server-side provider component for ThunderID authentication.\n * Wraps the client-side provider and handles server-side authentication logic.\n * Uses the singleton ThunderIDNextClient instance for consistent authentication state.\n *\n * @param props - Props injected into the component.\n *\n * @example\n * ```tsx\n * <ThunderIDServerProvider config={thunderidConfig}>\n * <YourApp />\n * </ThunderIDServerProvider>\n * ```\n *\n * @returns ThunderIDServerProvider component.\n */\nconst ThunderIDServerProvider: FC<PropsWithChildren<ThunderIDServerProviderProps>> = async ({\n children,\n afterSignInUrl,\n afterSignOutUrl,\n ..._config\n}: PropsWithChildren<ThunderIDServerProviderProps>): Promise<ReactElement> => {\n const thunderIDClient = getClient();\n let config: Partial<ThunderIDNextConfig> = {};\n\n try {\n await thunderIDClient.initialize(_config as ThunderIDNextConfig);\n\n logger.debug('[ThunderIDServerProvider] ThunderID client initialized successfully.');\n\n config = await thunderIDClient.getConfiguration();\n } catch (error) {\n logger.error('[ThunderIDServerProvider] Failed to initialize ThunderID client:', error?.toString());\n\n throw new ThunderIDRuntimeError(\n `Failed to initialize ThunderID client: ${error?.toString()}`,\n 'next-ConfigurationError-001',\n 'next',\n 'An error occurred while initializing the ThunderID client. Please check your configuration.',\n );\n }\n\n if (!thunderIDClient.isInitialized) {\n return <></>;\n }\n\n // Try to get session information from JWT first, then fall back to legacy\n const sessionPayload: SessionTokenPayload | undefined = await getSessionPayload();\n const sessionId: string = sessionPayload?.sessionId || (await getSessionId()) || '';\n const signedIn: boolean = await isSignedIn(sessionId);\n\n let user: User = {};\n let userProfile: UserProfile = {\n flattenedProfile: {},\n profile: {},\n schemas: [],\n };\n if (signedIn) {\n let updatedBaseUrl: string | undefined = config?.baseUrl;\n\n if (sessionPayload?.organizationId) {\n updatedBaseUrl = `${config?.baseUrl}/o`;\n config = {...config, baseUrl: updatedBaseUrl};\n } else if (sessionId) {\n try {\n const idToken: IdToken = await thunderIDClient.getDecodedIdToken(sessionId);\n if (idToken?.['user_org']) {\n updatedBaseUrl = `${config?.baseUrl}/o`;\n config = {...config, baseUrl: updatedBaseUrl};\n }\n } catch {\n // Continue without organization info\n }\n }\n\n // Check if user profile fetching is enabled (default: true)\n const shouldFetchUserProfile: boolean = config?.preferences?.user?.fetchUserProfile !== false;\n\n if (shouldFetchUserProfile) {\n try {\n const userResponse: {\n data: {user: User | null};\n error: string | null;\n success: boolean;\n } = await getUserAction(sessionId);\n const userProfileResponse: {\n data: {userProfile: UserProfile};\n error: string | null;\n success: boolean;\n } = await getUserProfileAction(sessionId);\n\n user = userResponse.data?.user || {};\n userProfile = userProfileResponse.data?.userProfile ?? userProfile;\n } catch (error) {\n logger.warn('[ThunderIDServerProvider] Failed to fetch user profile from SCIM2:', error?.toString());\n }\n }\n }\n\n return (\n <ThunderIDClientProvider\n organizationHandle={config?.organizationHandle}\n applicationId={config?.applicationId}\n baseUrl={config?.baseUrl}\n signIn={signInAction}\n clearSession={clearSession}\n refreshToken={refreshToken}\n signOut={signOutAction}\n signUp={signUpAction}\n handleOAuthCallback={handleOAuthCallbackAction}\n signInUrl={config?.signInUrl}\n signUpUrl={config?.signUpUrl}\n preferences={config?.preferences}\n clientId={config?.clientId}\n user={user}\n userProfile={userProfile}\n updateProfile={updateUserProfileAction}\n isSignedIn={signedIn}\n >\n {children}\n </ThunderIDClientProvider>\n );\n};\n\nexport default ThunderIDServerProvider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8EA,MAAMA,0BAA+E,OAAO,EAC1F,UACA,gBACA,gBACA,GAAG,cACyE;CAC5E,MAAM,kBAAkBC,mBAAW;CACnC,IAAIC,SAAuC,EAAE;AAE7C,KAAI;AACF,QAAM,gBAAgB,WAAW,QAA+B;AAEhE,iBAAO,MAAM,uEAAuE;AAEpF,WAAS,MAAM,gBAAgB,kBAAkB;UAC1C,OAAO;AACd,iBAAO,MAAM,oEAAoE,OAAO,UAAU,CAAC;AAEnG,QAAM,IAAI,sBACR,0CAA0C,OAAO,UAAU,IAC3D,+BACA,QACA,8FACD;;AAGH,KAAI,CAAC,gBAAgB,cACnB,QAAO,iCAAK;CAId,MAAMC,iBAAkD,MAAMC,2BAAmB;CACjF,MAAMC,YAAoB,gBAAgB,aAAc,MAAMC,sBAAc,IAAK;CACjF,MAAMC,WAAoB,MAAMC,mBAAW,UAAU;CAErD,IAAIC,OAAa,EAAE;CACnB,IAAIC,cAA2B;EAC7B,kBAAkB,EAAE;EACpB,SAAS,EAAE;EACX,SAAS,EAAE;EACZ;AACD,KAAI,UAAU;EACZ,IAAIC,iBAAqC,QAAQ;AAEjD,MAAI,gBAAgB,gBAAgB;AAClC,oBAAiB,GAAG,QAAQ,QAAQ;AACpC,YAAS;IAAC,GAAG;IAAQ,SAAS;IAAe;aACpC,UACT,KAAI;AAEF,QADyB,MAAM,gBAAgB,kBAAkB,UAAU,IAC7D,aAAa;AACzB,qBAAiB,GAAG,QAAQ,QAAQ;AACpC,aAAS;KAAC,GAAG;KAAQ,SAAS;KAAe;;UAEzC;AAQV,MAFwC,QAAQ,aAAa,MAAM,qBAAqB,MAGtF,KAAI;GACF,MAAMC,eAIF,MAAMC,sBAAc,UAAU;GAClC,MAAMC,sBAIF,MAAMC,6BAAqB,UAAU;AAEzC,UAAO,aAAa,MAAM,QAAQ,EAAE;AACpC,iBAAc,oBAAoB,MAAM,eAAe;WAChD,OAAO;AACd,kBAAO,KAAK,sEAAsE,OAAO,UAAU,CAAC;;;AAK1G,QACE,oBAACC;EACC,oBAAoB,QAAQ;EAC5B,eAAe,QAAQ;EACvB,SAAS,QAAQ;EACjB,QAAQC;EACR,cAAcC;EACd,cAAcC;EACd,SAASC;EACT,QAAQC;EACR,qBAAqBC;EACrB,WAAW,QAAQ;EACnB,WAAW,QAAQ;EACnB,aAAa,QAAQ;EACrB,UAAU,QAAQ;EACZ;EACO;EACb,eAAeC;EACf,YAAY;EAEX;GACuB;;AAI9B,kCAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearSession.d.ts","sourceRoot":"","sources":["../../../src/server/actions/clearSession.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAUH;;;;;;;;;;;;;;;;;;;GAmBG;AACH,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,IAAI,CAK1C,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import SessionManager_default from "../../utils/SessionManager.js";
|
|
5
|
+
import logger_default from "../../utils/logger.js";
|
|
6
|
+
import { cookies } from "next/headers";
|
|
7
|
+
|
|
8
|
+
//#region src/server/actions/clearSession.ts
|
|
9
|
+
/**
|
|
10
|
+
* Deletes all ThunderID session cookies from the browser without contacting the
|
|
11
|
+
* identity server.
|
|
12
|
+
*
|
|
13
|
+
* Use this for error-recovery scenarios where the local session must be wiped
|
|
14
|
+
* immediately: refresh token failures, corrupt sessions, or forced local sign-out
|
|
15
|
+
* when the identity server is unreachable.
|
|
16
|
+
*
|
|
17
|
+
* For a complete sign-out that also revokes the server-side session and obtains the
|
|
18
|
+
* after-sign-out redirect URL, use `signOutAction` instead.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```typescript
|
|
22
|
+
* import { clearSession } from '@thunderid/nextjs/server';
|
|
23
|
+
*
|
|
24
|
+
* // Inside a Server Action or Route Handler:
|
|
25
|
+
* await clearSession();
|
|
26
|
+
* redirect('/sign-in');
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
const clearSession = async () => {
|
|
30
|
+
const cookieStore = await cookies();
|
|
31
|
+
cookieStore.delete(SessionManager_default.getSessionCookieName());
|
|
32
|
+
cookieStore.delete(SessionManager_default.getTempSessionCookieName());
|
|
33
|
+
logger_default.debug("[clearSession] Session cookies cleared.");
|
|
34
|
+
};
|
|
35
|
+
var clearSession_default = clearSession;
|
|
36
|
+
|
|
37
|
+
//#endregion
|
|
38
|
+
export { clearSession_default as default };
|
|
39
|
+
//# sourceMappingURL=clearSession.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clearSession.js","names":["cookieStore: RequestCookies","SessionManager"],"sources":["../../../src/server/actions/clearSession.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 server';\n\nimport {cookies} from 'next/headers';\nimport logger from '../../utils/logger';\nimport SessionManager from '../../utils/SessionManager';\n\ntype RequestCookies = Awaited<ReturnType<typeof cookies>>;\n\n/**\n * Deletes all ThunderID session cookies from the browser without contacting the\n * identity server.\n *\n * Use this for error-recovery scenarios where the local session must be wiped\n * immediately: refresh token failures, corrupt sessions, or forced local sign-out\n * when the identity server is unreachable.\n *\n * For a complete sign-out that also revokes the server-side session and obtains the\n * after-sign-out redirect URL, use `signOutAction` instead.\n *\n * @example\n * ```typescript\n * import { clearSession } from '@thunderid/nextjs/server';\n *\n * // Inside a Server Action or Route Handler:\n * await clearSession();\n * redirect('/sign-in');\n * ```\n */\nconst clearSession = async (): Promise<void> => {\n const cookieStore: RequestCookies = await cookies();\n cookieStore.delete(SessionManager.getSessionCookieName());\n cookieStore.delete(SessionManager.getTempSessionCookieName());\n logger.debug('[clearSession] Session cookies cleared.');\n};\n\nexport default clearSession;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8CA,MAAM,eAAe,YAA2B;CAC9C,MAAMA,cAA8B,MAAM,SAAS;AACnD,aAAY,OAAOC,uBAAe,sBAAsB,CAAC;AACzD,aAAY,OAAOA,uBAAe,0BAA0B,CAAC;AAC7D,gBAAO,MAAM,0CAA0C;;AAGzD,2BAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccessToken.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getAccessToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH;;;;GAIG;AACH,QAAA,MAAM,cAAc,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAgB1D,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import SessionManager_default from "../../utils/SessionManager.js";
|
|
5
|
+
import { cookies } from "next/headers";
|
|
3
6
|
|
|
4
7
|
//#region src/server/actions/getAccessToken.ts
|
|
5
|
-
var import_headers = /* @__PURE__ */ __toESM(require_headers(), 1);
|
|
6
8
|
/**
|
|
7
9
|
* Get the access token from the session cookie.
|
|
8
10
|
*
|
|
9
11
|
* @returns The access token if it exists, undefined otherwise
|
|
10
12
|
*/
|
|
11
13
|
const getAccessToken = async () => {
|
|
12
|
-
const sessionToken = (await
|
|
14
|
+
const sessionToken = (await cookies()).get(SessionManager_default.getSessionCookieName())?.value;
|
|
13
15
|
if (sessionToken) try {
|
|
14
16
|
return (await SessionManager_default.verifySessionToken(sessionToken))["accessToken"];
|
|
15
17
|
} catch (error) {
|
|
@@ -19,4 +21,5 @@ const getAccessToken = async () => {
|
|
|
19
21
|
var getAccessToken_default = getAccessToken;
|
|
20
22
|
|
|
21
23
|
//#endregion
|
|
22
|
-
export { getAccessToken_default as default };
|
|
24
|
+
export { getAccessToken_default as default };
|
|
25
|
+
//# sourceMappingURL=getAccessToken.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getAccessToken.js","names":["sessionToken: string | undefined","SessionManager"],"sources":["../../../src/server/actions/getAccessToken.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 server';\n\nimport {cookies} from 'next/headers';\nimport SessionManager, {SessionTokenPayload} from '../../utils/SessionManager';\n\ntype RequestCookies = Awaited<ReturnType<typeof cookies>>;\n\n/**\n * Get the access token from the session cookie.\n *\n * @returns The access token if it exists, undefined otherwise\n */\nconst getAccessToken = async (): Promise<string | undefined> => {\n const cookieStore: RequestCookies = await cookies();\n\n const sessionToken: string | undefined = cookieStore.get(SessionManager.getSessionCookieName())?.value;\n\n if (sessionToken) {\n try {\n const sessionPayload: SessionTokenPayload = await SessionManager.verifySessionToken(sessionToken);\n\n return sessionPayload['accessToken'] as string;\n } catch (error) {\n return undefined;\n }\n }\n\n return undefined;\n};\n\nexport default getAccessToken;\n"],"mappings":";;;;;;;;;;;;AA8BA,MAAM,iBAAiB,YAAyC;CAG9D,MAAMA,gBAF8B,MAAM,SAAS,EAEE,IAAIC,uBAAe,sBAAsB,CAAC,EAAE;AAEjG,KAAI,aACF,KAAI;AAGF,UAF4C,MAAMA,uBAAe,mBAAmB,aAAa,EAE3E;UACf,OAAO;AACd;;;AAON,6BAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getClientOrigin.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getClientOrigin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAOH,QAAA,MAAM,eAAe,QAAa,OAAO,CAAC,MAAM,CAK/C,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import { headers } from "next/headers";
|
|
5
|
+
|
|
6
|
+
//#region src/server/actions/getClientOrigin.ts
|
|
7
|
+
const getClientOrigin = async () => {
|
|
8
|
+
const headersList = await headers();
|
|
9
|
+
const host = headersList.get("host");
|
|
10
|
+
return `${headersList.get("x-forwarded-proto") ?? "http"}://${host}`;
|
|
11
|
+
};
|
|
12
|
+
var getClientOrigin_default = getClientOrigin;
|
|
13
|
+
|
|
14
|
+
//#endregion
|
|
15
|
+
export { getClientOrigin_default as default };
|
|
16
|
+
//# sourceMappingURL=getClientOrigin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getClientOrigin.js","names":["headersList: ReadonlyHeaders","host: string | null"],"sources":["../../../src/server/actions/getClientOrigin.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 server';\n\nimport {ReadonlyHeaders} from 'next/dist/server/web/spec-extension/adapters/headers';\nimport {headers} from 'next/headers';\n\nconst getClientOrigin = async (): Promise<string> => {\n const headersList: ReadonlyHeaders = await headers();\n const host: string | null = headersList.get('host');\n const protocol: string = headersList.get('x-forwarded-proto') ?? 'http';\n return `${protocol}://${host}`;\n};\n\nexport default getClientOrigin;\n"],"mappings":";;;;;;AAuBA,MAAM,kBAAkB,YAA6B;CACnD,MAAMA,cAA+B,MAAM,SAAS;CACpD,MAAMC,OAAsB,YAAY,IAAI,OAAO;AAEnD,QAAO,GADkB,YAAY,IAAI,oBAAoB,IAAI,OAC9C,KAAK;;AAG1B,8BAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionId.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getSessionId.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH;;;;;GAKG;AACH,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,MAAM,GAAG,SAAS,CAgBxD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import SessionManager_default from "../../utils/SessionManager.js";
|
|
5
|
+
import { cookies } from "next/headers";
|
|
3
6
|
|
|
4
7
|
//#region src/server/actions/getSessionId.ts
|
|
5
|
-
var import_headers = /* @__PURE__ */ __toESM(require_headers(), 1);
|
|
6
8
|
/**
|
|
7
9
|
* Get the session ID from cookies.
|
|
8
10
|
* Tries JWT session first, then falls back to legacy session ID.
|
|
@@ -10,7 +12,7 @@ var import_headers = /* @__PURE__ */ __toESM(require_headers(), 1);
|
|
|
10
12
|
* @returns The session ID if it exists, undefined otherwise
|
|
11
13
|
*/
|
|
12
14
|
const getSessionId = async () => {
|
|
13
|
-
const sessionToken = (await
|
|
15
|
+
const sessionToken = (await cookies()).get(SessionManager_default.getSessionCookieName())?.value;
|
|
14
16
|
if (sessionToken) try {
|
|
15
17
|
return (await SessionManager_default.verifySessionToken(sessionToken)).sessionId;
|
|
16
18
|
} catch (error) {
|
|
@@ -20,4 +22,5 @@ const getSessionId = async () => {
|
|
|
20
22
|
var getSessionId_default = getSessionId;
|
|
21
23
|
|
|
22
24
|
//#endregion
|
|
23
|
-
export { getSessionId_default as
|
|
25
|
+
export { getSessionId_default as default };
|
|
26
|
+
//# sourceMappingURL=getSessionId.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionId.js","names":["sessionToken: string | undefined","SessionManager"],"sources":["../../../src/server/actions/getSessionId.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 server';\n\nimport {cookies} from 'next/headers';\nimport SessionManager, {SessionTokenPayload} from '../../utils/SessionManager';\n\ntype RequestCookies = Awaited<ReturnType<typeof cookies>>;\n\n/**\n * Get the session ID from cookies.\n * Tries JWT session first, then falls back to legacy session ID.\n *\n * @returns The session ID if it exists, undefined otherwise\n */\nconst getSessionId = async (): Promise<string | undefined> => {\n const cookieStore: RequestCookies = await cookies();\n\n const sessionToken: string | undefined = cookieStore.get(SessionManager.getSessionCookieName())?.value;\n\n if (sessionToken) {\n try {\n const sessionPayload: SessionTokenPayload = await SessionManager.verifySessionToken(sessionToken);\n\n return sessionPayload.sessionId;\n } catch (error) {\n return undefined;\n }\n }\n\n return undefined;\n};\n\nexport default getSessionId;\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,eAAe,YAAyC;CAG5D,MAAMA,gBAF8B,MAAM,SAAS,EAEE,IAAIC,uBAAe,sBAAsB,CAAC,EAAE;AAEjG,KAAI,aACF,KAAI;AAGF,UAF4C,MAAMA,uBAAe,mBAAmB,aAAa,EAE3E;UACf,OAAO;AACd;;;AAON,2BAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionPayload.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getSessionPayload.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAuB,EAAC,mBAAmB,EAAC,MAAM,4BAA4B,CAAC;AAI/E;;;;;GAKG;AACH,QAAA,MAAM,iBAAiB,QAAa,OAAO,CAAC,mBAAmB,GAAG,SAAS,CAa1E,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import SessionManager_default from "../../utils/SessionManager.js";
|
|
5
|
+
import { cookies } from "next/headers";
|
|
6
|
+
|
|
7
|
+
//#region src/server/actions/getSessionPayload.ts
|
|
8
|
+
/**
|
|
9
|
+
* Get the session payload from JWT session cookie.
|
|
10
|
+
* This includes user ID, session ID, scopes, and organization ID.
|
|
11
|
+
*
|
|
12
|
+
* @returns The session payload if valid JWT session exists, undefined otherwise
|
|
13
|
+
*/
|
|
14
|
+
const getSessionPayload = async () => {
|
|
15
|
+
const sessionToken = (await cookies()).get(SessionManager_default.getSessionCookieName())?.value;
|
|
16
|
+
if (!sessionToken) return;
|
|
17
|
+
try {
|
|
18
|
+
return await SessionManager_default.verifySessionToken(sessionToken);
|
|
19
|
+
} catch {
|
|
20
|
+
return;
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
var getSessionPayload_default = getSessionPayload;
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { getSessionPayload_default as default };
|
|
27
|
+
//# sourceMappingURL=getSessionPayload.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getSessionPayload.js","names":["sessionToken: string | undefined","SessionManager"],"sources":["../../../src/server/actions/getSessionPayload.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 server';\n\nimport {cookies} from 'next/headers';\nimport SessionManager, {SessionTokenPayload} from '../../utils/SessionManager';\n\ntype RequestCookies = Awaited<ReturnType<typeof cookies>>;\n\n/**\n * Get the session payload from JWT session cookie.\n * This includes user ID, session ID, scopes, and organization ID.\n *\n * @returns The session payload if valid JWT session exists, undefined otherwise\n */\nconst getSessionPayload = async (): Promise<SessionTokenPayload | undefined> => {\n const cookieStore: RequestCookies = await cookies();\n\n const sessionToken: string | undefined = cookieStore.get(SessionManager.getSessionCookieName())?.value;\n if (!sessionToken) {\n return undefined;\n }\n\n try {\n return await SessionManager.verifySessionToken(sessionToken);\n } catch {\n return undefined;\n }\n};\n\nexport default getSessionPayload;\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAM,oBAAoB,YAAsD;CAG9E,MAAMA,gBAF8B,MAAM,SAAS,EAEE,IAAIC,uBAAe,sBAAsB,CAAC,EAAE;AACjG,KAAI,CAAC,aACH;AAGF,KAAI;AACF,SAAO,MAAMA,uBAAe,mBAAmB,aAAa;SACtD;AACN;;;AAIJ,gCAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserAction.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getUserAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAC,IAAI,EAAC,MAAM,iBAAiB,CAAC;AAGrC;;;GAGG;AACH,QAAA,MAAM,aAAa,GACjB,WAAW,MAAM,KAChB,OAAO,CAAC;IAAC,IAAI,EAAE;QAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAAA;KAAC,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CAQ7E,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import getClient_default from "../getClient.js";
|
|
5
|
+
|
|
6
|
+
//#region src/server/actions/getUserAction.ts
|
|
7
|
+
/**
|
|
8
|
+
* Server action to get the current user.
|
|
9
|
+
* Returns the user profile if signed in.
|
|
10
|
+
*/
|
|
11
|
+
const getUserAction = async (sessionId) => {
|
|
12
|
+
try {
|
|
13
|
+
return {
|
|
14
|
+
data: { user: await getClient_default().getUser(sessionId) },
|
|
15
|
+
error: null,
|
|
16
|
+
success: true
|
|
17
|
+
};
|
|
18
|
+
} catch (error) {
|
|
19
|
+
return {
|
|
20
|
+
data: { user: null },
|
|
21
|
+
error: "Failed to get user",
|
|
22
|
+
success: false
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var getUserAction_default = getUserAction;
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { getUserAction_default as default };
|
|
30
|
+
//# sourceMappingURL=getUserAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserAction.js","names":["getClient"],"sources":["../../../src/server/actions/getUserAction.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 server';\n\nimport {User} from '@thunderid/node';\nimport getClient from '../getClient';\n\n/**\n * Server action to get the current user.\n * Returns the user profile if signed in.\n */\nconst getUserAction = async (\n sessionId: string,\n): Promise<{data: {user: User | null}; error: string | null; success: boolean}> => {\n try {\n const client = getClient();\n const user: User = await client.getUser(sessionId);\n return {data: {user}, error: null, success: true};\n } catch (error) {\n return {data: {user: null}, error: 'Failed to get user', success: false};\n }\n};\n\nexport default getUserAction;\n"],"mappings":";;;;;;;;;;AA2BA,MAAM,gBAAgB,OACpB,cACiF;AACjF,KAAI;AAGF,SAAO;GAAC,MAAM,EAAC,MADI,MADJA,mBAAW,CACM,QAAQ,UAAU,EAC9B;GAAE,OAAO;GAAM,SAAS;GAAK;UAC1C,OAAO;AACd,SAAO;GAAC,MAAM,EAAC,MAAM,MAAK;GAAE,OAAO;GAAsB,SAAS;GAAM;;;AAI5E,4BAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserProfileAction.d.ts","sourceRoot":"","sources":["../../../src/server/actions/getUserProfileAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAG5C;;;GAGG;AACH,QAAA,MAAM,oBAAoB,GACxB,WAAW,MAAM,KAChB,OAAO,CAAC;IAAC,IAAI,EAAE;QAAC,WAAW,EAAE,WAAW,CAAA;KAAC,CAAC;IAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAC,CAkBpF,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import getClient_default from "../getClient.js";
|
|
5
|
+
|
|
6
|
+
//#region src/server/actions/getUserProfileAction.ts
|
|
7
|
+
/**
|
|
8
|
+
* Server action to get the current user.
|
|
9
|
+
* Returns the user profile if signed in.
|
|
10
|
+
*/
|
|
11
|
+
const getUserProfileAction = async (sessionId) => {
|
|
12
|
+
try {
|
|
13
|
+
return {
|
|
14
|
+
data: { userProfile: await getClient_default().getUserProfile(sessionId) },
|
|
15
|
+
error: null,
|
|
16
|
+
success: true
|
|
17
|
+
};
|
|
18
|
+
} catch (error) {
|
|
19
|
+
return {
|
|
20
|
+
data: { userProfile: {
|
|
21
|
+
flattenedProfile: {},
|
|
22
|
+
profile: {},
|
|
23
|
+
schemas: []
|
|
24
|
+
} },
|
|
25
|
+
error: "Failed to get user profile",
|
|
26
|
+
success: false
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
var getUserProfileAction_default = getUserProfileAction;
|
|
31
|
+
|
|
32
|
+
//#endregion
|
|
33
|
+
export { getUserProfileAction_default as default };
|
|
34
|
+
//# sourceMappingURL=getUserProfileAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getUserProfileAction.js","names":["getClient"],"sources":["../../../src/server/actions/getUserProfileAction.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 server';\n\nimport {UserProfile} from '@thunderid/node';\nimport getClient from '../getClient';\n\n/**\n * Server action to get the current user.\n * Returns the user profile if signed in.\n */\nconst getUserProfileAction = async (\n sessionId: string,\n): Promise<{data: {userProfile: UserProfile}; error: string | null; success: boolean}> => {\n try {\n const client = getClient();\n const updatedProfile: UserProfile = await client.getUserProfile(sessionId);\n return {data: {userProfile: updatedProfile}, error: null, success: true};\n } catch (error) {\n return {\n data: {\n userProfile: {\n flattenedProfile: {},\n profile: {},\n schemas: [],\n },\n },\n error: 'Failed to get user profile',\n success: false,\n };\n }\n};\n\nexport default getUserProfileAction;\n"],"mappings":";;;;;;;;;;AA2BA,MAAM,uBAAuB,OAC3B,cACwF;AACxF,KAAI;AAGF,SAAO;GAAC,MAAM,EAAC,aADqB,MADrBA,mBAAW,CACuB,eAAe,UAAU,EAC/B;GAAE,OAAO;GAAM,SAAS;GAAK;UACjE,OAAO;AACd,SAAO;GACL,MAAM,EACJ,aAAa;IACX,kBAAkB,EAAE;IACpB,SAAS,EAAE;IACX,SAAS,EAAE;IACZ,EACF;GACD,OAAO;GACP,SAAS;GACV;;;AAIL,mCAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleOAuthCallbackAction.d.ts","sourceRoot":"","sources":["../../../src/server/actions/handleOAuthCallbackAction.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH;;;;;;;;;GASG;AACH,QAAA,MAAM,yBAAyB,GAC7B,MAAM,MAAM,EACZ,OAAO,MAAM,EACb,eAAe,MAAM,KACpB,OAAO,CAAC;IACT,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,OAAO,CAAC;CAClB,CAyHA,CAAC;AAEF,eAAe,yBAAyB,CAAC"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import SessionManager_default from "../../utils/SessionManager.js";
|
|
5
|
+
import getClient_default from "../getClient.js";
|
|
6
|
+
import logger_default from "../../utils/logger.js";
|
|
7
|
+
import { cookies } from "next/headers";
|
|
8
|
+
|
|
9
|
+
//#region src/server/actions/handleOAuthCallbackAction.ts
|
|
10
|
+
/**
|
|
11
|
+
* Server action to handle OAuth callback with authorization code.
|
|
12
|
+
* This action processes the authorization code received from the OAuth provider
|
|
13
|
+
* and exchanges it for tokens to complete the authentication flow.
|
|
14
|
+
*
|
|
15
|
+
* @param code - Authorization code from OAuth provider
|
|
16
|
+
* @param state - State parameter from OAuth provider for CSRF protection
|
|
17
|
+
* @param sessionState - Session state parameter from OAuth provider
|
|
18
|
+
* @returns Promise that resolves with success status and optional error message
|
|
19
|
+
*/
|
|
20
|
+
const handleOAuthCallbackAction = async (code, state, sessionState) => {
|
|
21
|
+
try {
|
|
22
|
+
if (!code || !state) return {
|
|
23
|
+
error: "Missing required OAuth parameters: code and state are required",
|
|
24
|
+
success: false
|
|
25
|
+
};
|
|
26
|
+
const thunderIDClient = getClient_default();
|
|
27
|
+
if (!thunderIDClient.isInitialized) return {
|
|
28
|
+
error: "ThunderID client is not initialized",
|
|
29
|
+
success: false
|
|
30
|
+
};
|
|
31
|
+
const cookieStore = await cookies();
|
|
32
|
+
let sessionId;
|
|
33
|
+
const tempSessionToken = cookieStore.get(SessionManager_default.getTempSessionCookieName())?.value;
|
|
34
|
+
if (tempSessionToken) try {
|
|
35
|
+
sessionId = (await SessionManager_default.verifyTempSession(tempSessionToken)).sessionId;
|
|
36
|
+
} catch {
|
|
37
|
+
logger_default.error("[handleOAuthCallbackAction] Invalid temporary session token, falling back to session ID from cookies.");
|
|
38
|
+
}
|
|
39
|
+
if (!sessionId) {
|
|
40
|
+
logger_default.error("[handleOAuthCallbackAction] No session ID found in cookies or temporary session token.");
|
|
41
|
+
return {
|
|
42
|
+
error: "No session found. Please start the authentication flow again.",
|
|
43
|
+
success: false
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
const signInResult = await thunderIDClient.signIn({
|
|
47
|
+
code,
|
|
48
|
+
session_state: sessionState,
|
|
49
|
+
state
|
|
50
|
+
}, {}, sessionId);
|
|
51
|
+
const config = await thunderIDClient.getConfiguration();
|
|
52
|
+
if (signInResult) try {
|
|
53
|
+
const idToken = await thunderIDClient.getDecodedIdToken(sessionId, signInResult["id_token"] || signInResult["idToken"]);
|
|
54
|
+
const accessToken = signInResult["accessToken"] || signInResult["access_token"];
|
|
55
|
+
const refreshToken = signInResult["refreshToken"] ?? "";
|
|
56
|
+
const userIdFromToken = idToken.sub || signInResult["sub"] || sessionId;
|
|
57
|
+
const scopes = signInResult["scope"];
|
|
58
|
+
const organizationId = idToken["user_org"] || idToken["organization_id"];
|
|
59
|
+
const expiresIn = signInResult["expiresIn"];
|
|
60
|
+
const sessionCookieExpiryTime = SessionManager_default.resolveSessionCookieExpiry(config.sessionCookie?.expiryTime);
|
|
61
|
+
const sessionToken = await SessionManager_default.createSessionToken(accessToken, userIdFromToken, sessionId, scopes, expiresIn, refreshToken, organizationId);
|
|
62
|
+
cookieStore.set(SessionManager_default.getSessionCookieName(), sessionToken, SessionManager_default.getSessionCookieOptions(sessionCookieExpiryTime));
|
|
63
|
+
cookieStore.delete(SessionManager_default.getTempSessionCookieName());
|
|
64
|
+
} catch (error) {
|
|
65
|
+
logger_default.error(`[handleOAuthCallbackAction] Failed to create JWT session, continuing with legacy session:
|
|
66
|
+
${typeof error === "string" ? error : JSON.stringify(error)}`);
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
redirectUrl: config.afterSignInUrl || "/",
|
|
70
|
+
success: true
|
|
71
|
+
};
|
|
72
|
+
} catch (error) {
|
|
73
|
+
let errorMessage = "Authentication failed";
|
|
74
|
+
if (error instanceof Error) errorMessage = error.message;
|
|
75
|
+
else if (error && typeof error === "object" && "message" in error) errorMessage = String(error.message);
|
|
76
|
+
else if (typeof error === "string") errorMessage = error;
|
|
77
|
+
return {
|
|
78
|
+
error: errorMessage,
|
|
79
|
+
success: false
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
};
|
|
83
|
+
var handleOAuthCallbackAction_default = handleOAuthCallbackAction;
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { handleOAuthCallbackAction_default as default };
|
|
87
|
+
//# sourceMappingURL=handleOAuthCallbackAction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handleOAuthCallbackAction.js","names":["getClient","cookieStore: RequestCookies","sessionId: string | undefined","tempSessionToken: string | undefined","SessionManager","signInResult: Record<string, unknown>","config: ThunderIDNextConfig","idToken: IdToken","accessToken: string","refreshToken: string","userIdFromToken: string","scopes: string","organizationId: string | undefined","expiresIn: number","sessionCookieExpiryTime: number","sessionToken: string"],"sources":["../../../src/server/actions/handleOAuthCallbackAction.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 server';\n\nimport {IdToken} from '@thunderid/node';\nimport {cookies} from 'next/headers';\nimport {ThunderIDNextConfig} from '../../models/config';\nimport logger from '../../utils/logger';\nimport SessionManager from '../../utils/SessionManager';\nimport getClient from '../getClient';\n\ntype RequestCookies = Awaited<ReturnType<typeof cookies>>;\n\n/**\n * Server action to handle OAuth callback with authorization code.\n * This action processes the authorization code received from the OAuth provider\n * and exchanges it for tokens to complete the authentication flow.\n *\n * @param code - Authorization code from OAuth provider\n * @param state - State parameter from OAuth provider for CSRF protection\n * @param sessionState - Session state parameter from OAuth provider\n * @returns Promise that resolves with success status and optional error message\n */\nconst handleOAuthCallbackAction = async (\n code: string,\n state: string,\n sessionState?: string,\n): Promise<{\n error?: string;\n redirectUrl?: string;\n success: boolean;\n}> => {\n try {\n if (!code || !state) {\n return {\n error: 'Missing required OAuth parameters: code and state are required',\n success: false,\n };\n }\n\n const thunderIDClient = getClient();\n\n if (!thunderIDClient.isInitialized) {\n return {\n error: 'ThunderID client is not initialized',\n success: false,\n };\n }\n\n const cookieStore: RequestCookies = await cookies();\n let sessionId: string | undefined;\n\n const tempSessionToken: string | undefined = cookieStore.get(SessionManager.getTempSessionCookieName())?.value;\n\n if (tempSessionToken) {\n try {\n const tempSession: {sessionId: string} = await SessionManager.verifyTempSession(tempSessionToken);\n sessionId = tempSession.sessionId;\n } catch {\n logger.error(\n '[handleOAuthCallbackAction] Invalid temporary session token, falling back to session ID from cookies.',\n );\n }\n }\n\n if (!sessionId) {\n logger.error('[handleOAuthCallbackAction] No session ID found in cookies or temporary session token.');\n\n return {\n error: 'No session found. Please start the authentication flow again.',\n success: false,\n };\n }\n\n // Exchange the authorization code for tokens\n const signInResult: Record<string, unknown> = await thunderIDClient.signIn(\n {\n code,\n session_state: sessionState,\n state,\n } as any,\n {},\n sessionId,\n );\n\n const config: ThunderIDNextConfig = await thunderIDClient.getConfiguration();\n\n if (signInResult) {\n try {\n const idToken: IdToken = await thunderIDClient.getDecodedIdToken(\n sessionId,\n (signInResult['id_token'] || signInResult['idToken']) as string,\n );\n const accessToken: string = (signInResult['accessToken'] || signInResult['access_token']) as string;\n const refreshToken: string = (signInResult['refreshToken'] as string | undefined) ?? '';\n const userIdFromToken: string = (idToken.sub || signInResult['sub'] || sessionId) as string;\n const scopes: string = signInResult['scope'] as string;\n const organizationId: string | undefined = (idToken['user_org'] || idToken['organization_id']) as\n | string\n | undefined;\n const expiresIn: number = signInResult['expiresIn'] as number;\n const sessionCookieExpiryTime: number = SessionManager.resolveSessionCookieExpiry(\n config.sessionCookie?.expiryTime,\n );\n\n const sessionToken: string = await SessionManager.createSessionToken(\n accessToken,\n userIdFromToken,\n sessionId,\n scopes,\n expiresIn,\n refreshToken,\n organizationId,\n );\n\n cookieStore.set(\n SessionManager.getSessionCookieName(),\n sessionToken,\n SessionManager.getSessionCookieOptions(sessionCookieExpiryTime),\n );\n\n cookieStore.delete(SessionManager.getTempSessionCookieName());\n } catch (error) {\n logger.error(\n `[handleOAuthCallbackAction] Failed to create JWT session, continuing with legacy session:\n ${typeof error === 'string' ? error : JSON.stringify(error)}`,\n );\n }\n }\n\n const afterSignInUrl: string = config.afterSignInUrl || '/';\n\n return {\n redirectUrl: afterSignInUrl,\n success: true,\n };\n } catch (error) {\n let errorMessage = 'Authentication failed';\n\n if (error instanceof Error) {\n errorMessage = error.message;\n } else if (error && typeof error === 'object' && 'message' in error) {\n errorMessage = String((error as {message: unknown}).message);\n } else if (typeof error === 'string') {\n errorMessage = error;\n }\n\n return {\n error: errorMessage,\n success: false,\n };\n }\n};\n\nexport default handleOAuthCallbackAction;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuCA,MAAM,4BAA4B,OAChC,MACA,OACA,iBAKI;AACJ,KAAI;AACF,MAAI,CAAC,QAAQ,CAAC,MACZ,QAAO;GACL,OAAO;GACP,SAAS;GACV;EAGH,MAAM,kBAAkBA,mBAAW;AAEnC,MAAI,CAAC,gBAAgB,cACnB,QAAO;GACL,OAAO;GACP,SAAS;GACV;EAGH,MAAMC,cAA8B,MAAM,SAAS;EACnD,IAAIC;EAEJ,MAAMC,mBAAuC,YAAY,IAAIC,uBAAe,0BAA0B,CAAC,EAAE;AAEzG,MAAI,iBACF,KAAI;AAEF,gBADyC,MAAMA,uBAAe,kBAAkB,iBAAiB,EACzE;UAClB;AACN,kBAAO,MACL,wGACD;;AAIL,MAAI,CAAC,WAAW;AACd,kBAAO,MAAM,yFAAyF;AAEtG,UAAO;IACL,OAAO;IACP,SAAS;IACV;;EAIH,MAAMC,eAAwC,MAAM,gBAAgB,OAClE;GACE;GACA,eAAe;GACf;GACD,EACD,EAAE,EACF,UACD;EAED,MAAMC,SAA8B,MAAM,gBAAgB,kBAAkB;AAE5E,MAAI,aACF,KAAI;GACF,MAAMC,UAAmB,MAAM,gBAAgB,kBAC7C,WACC,aAAa,eAAe,aAAa,WAC3C;GACD,MAAMC,cAAuB,aAAa,kBAAkB,aAAa;GACzE,MAAMC,eAAwB,aAAa,mBAA0C;GACrF,MAAMC,kBAA2B,QAAQ,OAAO,aAAa,UAAU;GACvE,MAAMC,SAAiB,aAAa;GACpC,MAAMC,iBAAsC,QAAQ,eAAe,QAAQ;GAG3E,MAAMC,YAAoB,aAAa;GACvC,MAAMC,0BAAkCV,uBAAe,2BACrD,OAAO,eAAe,WACvB;GAED,MAAMW,eAAuB,MAAMX,uBAAe,mBAChD,aACA,iBACA,WACA,QACA,WACA,cACA,eACD;AAED,eAAY,IACVA,uBAAe,sBAAsB,EACrC,cACAA,uBAAe,wBAAwB,wBAAwB,CAChE;AAED,eAAY,OAAOA,uBAAe,0BAA0B,CAAC;WACtD,OAAO;AACd,kBAAO,MACL;YACE,OAAO,UAAU,WAAW,QAAQ,KAAK,UAAU,MAAM,GAC5D;;AAML,SAAO;GACL,aAH6B,OAAO,kBAAkB;GAItD,SAAS;GACV;UACM,OAAO;EACd,IAAI,eAAe;AAEnB,MAAI,iBAAiB,MACnB,gBAAe,MAAM;WACZ,SAAS,OAAO,UAAU,YAAY,aAAa,MAC5D,gBAAe,OAAQ,MAA6B,QAAQ;WACnD,OAAO,UAAU,SAC1B,gBAAe;AAGjB,SAAO;GACL,OAAO;GACP,SAAS;GACV;;;AAIL,wCAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSignedIn.d.ts","sourceRoot":"","sources":["../../../src/server/actions/isSignedIn.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH;;;;;;;;;;;GAWG;AACH,QAAA,MAAM,UAAU,GAAU,YAAY,MAAM,KAAG,OAAO,CAAC,OAAO,CA0B7D,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
import getSessionId_default from "./getSessionId.js";
|
|
5
|
+
import getClient_default from "../getClient.js";
|
|
6
|
+
import getSessionPayload_default from "./getSessionPayload.js";
|
|
7
|
+
|
|
8
|
+
//#region src/server/actions/isSignedIn.ts
|
|
9
|
+
/**
|
|
10
|
+
* Check if the user is currently signed in.
|
|
11
|
+
*
|
|
12
|
+
* For JWT-based sessions: the session JWT exp claim is now tied to the access
|
|
13
|
+
* token expiry. A successful jwtVerify (inside getSessionPayload) already proves
|
|
14
|
+
* exp > now, so no separate timestamp comparison is needed here.
|
|
15
|
+
*
|
|
16
|
+
* Falls back to the legacy SDK in-memory check when no JWT session cookie exists.
|
|
17
|
+
*
|
|
18
|
+
* @param sessionId - Optional session ID (used only for the legacy fallback path)
|
|
19
|
+
* @returns True if the user is signed in with a valid, non-expired token
|
|
20
|
+
*/
|
|
21
|
+
const isSignedIn = async (sessionId) => {
|
|
22
|
+
try {
|
|
23
|
+
if (await getSessionPayload_default()) return true;
|
|
24
|
+
const resolvedSessionId = sessionId || await getSessionId_default();
|
|
25
|
+
if (!resolvedSessionId) return false;
|
|
26
|
+
const client = getClient_default();
|
|
27
|
+
try {
|
|
28
|
+
return !!await client.getAccessToken(resolvedSessionId);
|
|
29
|
+
} catch {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
} catch {
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
var isSignedIn_default = isSignedIn;
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { isSignedIn_default as default };
|
|
40
|
+
//# sourceMappingURL=isSignedIn.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isSignedIn.js","names":["getSessionPayload","resolvedSessionId: string | undefined","getSessionId","getClient"],"sources":["../../../src/server/actions/isSignedIn.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 server';\n\nimport getSessionId from './getSessionId';\nimport getSessionPayload from './getSessionPayload';\nimport {SessionTokenPayload} from '../../utils/SessionManager';\nimport getClient from '../getClient';\n\n/**\n * Check if the user is currently signed in.\n *\n * For JWT-based sessions: the session JWT exp claim is now tied to the access\n * token expiry. A successful jwtVerify (inside getSessionPayload) already proves\n * exp > now, so no separate timestamp comparison is needed here.\n *\n * Falls back to the legacy SDK in-memory check when no JWT session cookie exists.\n *\n * @param sessionId - Optional session ID (used only for the legacy fallback path)\n * @returns True if the user is signed in with a valid, non-expired token\n */\nconst isSignedIn = async (sessionId?: string): Promise<boolean> => {\n try {\n const sessionPayload: SessionTokenPayload | undefined = await getSessionPayload();\n\n if (sessionPayload) {\n return true;\n }\n\n // No JWT session — fall back to the legacy SDK in-memory store check.\n const resolvedSessionId: string | undefined = sessionId || (await getSessionId());\n\n if (!resolvedSessionId) {\n return false;\n }\n\n const client = getClient();\n\n try {\n const accessToken: string = await client.getAccessToken(resolvedSessionId);\n return !!accessToken;\n } catch {\n return false;\n }\n } catch {\n return false;\n }\n};\n\nexport default isSignedIn;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAqCA,MAAM,aAAa,OAAO,cAAyC;AACjE,KAAI;AAGF,MAFwD,MAAMA,2BAAmB,CAG/E,QAAO;EAIT,MAAMC,oBAAwC,aAAc,MAAMC,sBAAc;AAEhF,MAAI,CAAC,kBACH,QAAO;EAGT,MAAM,SAASC,mBAAW;AAE1B,MAAI;AAEF,UAAO,CAAC,CADoB,MAAM,OAAO,eAAe,kBAAkB;UAEpE;AACN,UAAO;;SAEH;AACN,SAAO;;;AAIX,yBAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"refreshToken.d.ts","sourceRoot":"","sources":["../../../src/server/actions/refreshToken.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAaH;;;;;;;;;;GAUG;AACH,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;GAUG;AACH,QAAA,MAAM,YAAY,QAAa,OAAO,CAAC,aAAa,CAmEnD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|