@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.
Files changed (349) hide show
  1. package/dist/{types/ThunderIDNextClient.d.ts → ThunderIDNextClient.d.ts} +2 -9
  2. package/dist/ThunderIDNextClient.d.ts.map +1 -0
  3. package/dist/ThunderIDNextClient.js +161 -0
  4. package/dist/ThunderIDNextClient.js.map +1 -0
  5. package/dist/cjs/ThunderIDNextClient.cjs +163 -0
  6. package/dist/cjs/ThunderIDNextClient.cjs.map +1 -0
  7. package/dist/cjs/_virtual/rolldown_runtime.cjs +25 -0
  8. package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs +79 -0
  9. package/dist/cjs/client/components/actions/SignInButton/SignInButton.cjs.map +1 -0
  10. package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs +61 -0
  11. package/dist/cjs/client/components/actions/SignOutButton/SignOutButton.cjs.map +1 -0
  12. package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs +91 -0
  13. package/dist/cjs/client/components/actions/SignUpButton/SignUpButton.cjs.map +1 -0
  14. package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs +34 -0
  15. package/dist/cjs/client/components/control/SignedIn/SignedIn.cjs.map +1 -0
  16. package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs +34 -0
  17. package/dist/cjs/client/components/control/SignedOut/SignedOut.cjs.map +1 -0
  18. package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs +37 -0
  19. package/dist/cjs/client/components/presentation/SignIn/SignIn.cjs.map +1 -0
  20. package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs +79 -0
  21. package/dist/cjs/client/components/presentation/SignUp/SignUp.cjs.map +1 -0
  22. package/dist/cjs/client/components/presentation/User/User.cjs +49 -0
  23. package/dist/cjs/client/components/presentation/User/User.cjs.map +1 -0
  24. package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs +114 -0
  25. package/dist/cjs/client/components/presentation/UserDropdown/UserDropdown.cjs.map +1 -0
  26. package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs +52 -0
  27. package/dist/cjs/client/components/presentation/UserProfile/UserProfile.cjs.map +1 -0
  28. package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs +34 -0
  29. package/dist/cjs/client/contexts/ThunderID/ThunderIDContext.cjs.map +1 -0
  30. package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs +165 -0
  31. package/dist/cjs/client/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -0
  32. package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs +19 -0
  33. package/dist/cjs/client/contexts/ThunderID/useThunderID.cjs.map +1 -0
  34. package/dist/cjs/client/index.cjs +11 -0
  35. package/dist/cjs/constants/sessionConstants.cjs +55 -0
  36. package/dist/cjs/constants/sessionConstants.cjs.map +1 -0
  37. package/dist/cjs/index.cjs +35 -1037
  38. package/dist/cjs/server/ThunderIDProvider.cjs +114 -0
  39. package/dist/cjs/server/ThunderIDProvider.cjs.map +1 -0
  40. package/dist/cjs/server/actions/clearSession.cjs +41 -0
  41. package/dist/cjs/server/actions/clearSession.cjs.map +1 -0
  42. package/dist/cjs/server/actions/getAccessToken.cjs +27 -0
  43. package/dist/cjs/server/actions/getAccessToken.cjs.map +1 -0
  44. package/dist/cjs/server/actions/getClientOrigin.cjs +18 -0
  45. package/dist/cjs/server/actions/getClientOrigin.cjs.map +1 -0
  46. package/dist/cjs/server/actions/getSessionId.cjs +28 -0
  47. package/dist/cjs/server/actions/getSessionId.cjs.map +1 -0
  48. package/dist/cjs/server/actions/getSessionPayload.cjs +29 -0
  49. package/dist/cjs/server/actions/getSessionPayload.cjs.map +1 -0
  50. package/dist/cjs/server/actions/getUserAction.cjs +30 -0
  51. package/dist/cjs/server/actions/getUserAction.cjs.map +1 -0
  52. package/dist/cjs/server/actions/getUserProfileAction.cjs +34 -0
  53. package/dist/cjs/server/actions/getUserProfileAction.cjs.map +1 -0
  54. package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs +89 -0
  55. package/dist/cjs/server/actions/handleOAuthCallbackAction.cjs.map +1 -0
  56. package/dist/cjs/server/actions/isSignedIn.cjs +40 -0
  57. package/dist/cjs/server/actions/isSignedIn.cjs.map +1 -0
  58. package/dist/cjs/server/actions/refreshToken.cjs +61 -0
  59. package/dist/cjs/server/actions/refreshToken.cjs.map +1 -0
  60. package/dist/cjs/server/actions/signInAction.cjs +95 -0
  61. package/dist/cjs/server/actions/signInAction.cjs.map +1 -0
  62. package/dist/cjs/server/actions/signOutAction.cjs +57 -0
  63. package/dist/cjs/server/actions/signOutAction.cjs.map +1 -0
  64. package/dist/cjs/server/actions/signUpAction.cjs +27 -0
  65. package/dist/cjs/server/actions/signUpAction.cjs.map +1 -0
  66. package/dist/cjs/server/actions/updateUserProfileAction.cjs +30 -0
  67. package/dist/cjs/server/actions/updateUserProfileAction.cjs.map +1 -0
  68. package/dist/cjs/server/getClient.cjs +19 -0
  69. package/dist/cjs/server/getClient.cjs.map +1 -0
  70. package/dist/cjs/server/index.cjs +9 -0
  71. package/dist/cjs/server/proxy/createRouteMatcher.cjs +36 -0
  72. package/dist/cjs/server/proxy/createRouteMatcher.cjs.map +1 -0
  73. package/dist/cjs/server/proxy/thunderIDProxy.cjs +182 -0
  74. package/dist/cjs/server/proxy/thunderIDProxy.cjs.map +1 -0
  75. package/dist/cjs/server/thunderid.cjs +27 -0
  76. package/dist/cjs/server/thunderid.cjs.map +1 -0
  77. package/dist/cjs/utils/SessionManager.cjs +150 -0
  78. package/dist/cjs/utils/SessionManager.cjs.map +1 -0
  79. package/dist/cjs/utils/decorateConfigWithNextEnv.cjs +28 -0
  80. package/dist/cjs/utils/decorateConfigWithNextEnv.cjs.map +1 -0
  81. package/dist/cjs/utils/handleRefreshToken.cjs +62 -0
  82. package/dist/cjs/utils/handleRefreshToken.cjs.map +1 -0
  83. package/dist/cjs/utils/logger.cjs +11 -0
  84. package/dist/cjs/utils/logger.cjs.map +1 -0
  85. package/dist/cjs/utils/sessionUtils.cjs +40 -0
  86. package/dist/cjs/utils/sessionUtils.cjs.map +1 -0
  87. package/dist/client/components/actions/SignInButton/SignInButton.d.ts.map +1 -0
  88. package/dist/client/components/actions/SignInButton/SignInButton.js +73 -0
  89. package/dist/client/components/actions/SignInButton/SignInButton.js.map +1 -0
  90. package/dist/client/components/actions/SignOutButton/SignOutButton.d.ts.map +1 -0
  91. package/dist/client/components/actions/SignOutButton/SignOutButton.js +57 -0
  92. package/dist/client/components/actions/SignOutButton/SignOutButton.js.map +1 -0
  93. package/dist/client/components/actions/SignUpButton/SignUpButton.d.ts.map +1 -0
  94. package/dist/client/components/actions/SignUpButton/SignUpButton.js +85 -0
  95. package/dist/client/components/actions/SignUpButton/SignUpButton.js.map +1 -0
  96. package/dist/client/components/control/Loading/Loading.d.ts.map +1 -0
  97. package/dist/client/components/control/SignedIn/SignedIn.d.ts.map +1 -0
  98. package/dist/client/components/control/SignedIn/SignedIn.js +32 -0
  99. package/dist/client/components/control/SignedIn/SignedIn.js.map +1 -0
  100. package/dist/client/components/control/SignedOut/SignedOut.d.ts.map +1 -0
  101. package/dist/client/components/control/SignedOut/SignedOut.js +32 -0
  102. package/dist/client/components/control/SignedOut/SignedOut.js.map +1 -0
  103. package/dist/{types/client → client}/components/presentation/SignIn/SignIn.d.ts +0 -38
  104. package/dist/client/components/presentation/SignIn/SignIn.d.ts.map +1 -0
  105. package/dist/client/components/presentation/SignIn/SignIn.js +33 -0
  106. package/dist/client/components/presentation/SignIn/SignIn.js.map +1 -0
  107. package/dist/client/components/presentation/SignUp/SignUp.d.ts.map +1 -0
  108. package/dist/client/components/presentation/SignUp/SignUp.js +75 -0
  109. package/dist/client/components/presentation/SignUp/SignUp.js.map +1 -0
  110. package/dist/client/components/presentation/User/User.d.ts.map +1 -0
  111. package/dist/client/components/presentation/User/User.js +46 -0
  112. package/dist/client/components/presentation/User/User.js.map +1 -0
  113. package/dist/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +1 -0
  114. package/dist/client/components/presentation/UserDropdown/UserDropdown.js +110 -0
  115. package/dist/client/components/presentation/UserDropdown/UserDropdown.js.map +1 -0
  116. package/dist/client/components/presentation/UserProfile/UserProfile.d.ts.map +1 -0
  117. package/dist/client/components/presentation/UserProfile/UserProfile.js +49 -0
  118. package/dist/client/components/presentation/UserProfile/UserProfile.js.map +1 -0
  119. package/dist/client/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -0
  120. package/dist/client/contexts/ThunderID/ThunderIDContext.js +32 -0
  121. package/dist/client/contexts/ThunderID/ThunderIDContext.js.map +1 -0
  122. package/dist/{types/client → client}/contexts/ThunderID/ThunderIDProvider.d.ts +1 -8
  123. package/dist/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -0
  124. package/dist/client/contexts/ThunderID/ThunderIDProvider.js +159 -0
  125. package/dist/client/contexts/ThunderID/ThunderIDProvider.js.map +1 -0
  126. package/dist/client/contexts/ThunderID/useThunderID.d.ts.map +1 -0
  127. package/dist/client/contexts/ThunderID/useThunderID.js +17 -0
  128. package/dist/client/contexts/ThunderID/useThunderID.js.map +1 -0
  129. package/dist/{types/client → client}/index.d.ts +2 -10
  130. package/dist/client/index.d.ts.map +1 -0
  131. package/dist/client/index.js +13 -0
  132. package/dist/configs/InternalAuthAPIRoutesConfig.d.ts.map +1 -0
  133. package/dist/constants/sessionConstants.d.ts.map +1 -0
  134. package/dist/constants/sessionConstants.js +53 -0
  135. package/dist/constants/sessionConstants.js.map +1 -0
  136. package/dist/index.d.ts.map +1 -0
  137. package/dist/index.js +20 -981
  138. package/dist/models/api.d.ts.map +1 -0
  139. package/dist/models/config.d.ts.map +1 -0
  140. package/dist/server/ThunderIDProvider.d.ts.map +1 -0
  141. package/dist/server/ThunderIDProvider.js +111 -0
  142. package/dist/server/ThunderIDProvider.js.map +1 -0
  143. package/dist/server/actions/clearSession.d.ts.map +1 -0
  144. package/dist/server/actions/clearSession.js +39 -0
  145. package/dist/server/actions/clearSession.js.map +1 -0
  146. package/dist/server/actions/getAccessToken.d.ts.map +1 -0
  147. package/dist/{getAccessToken-DCP_zasP.js → server/actions/getAccessToken.js} +8 -5
  148. package/dist/server/actions/getAccessToken.js.map +1 -0
  149. package/dist/server/actions/getClientOrigin.d.ts.map +1 -0
  150. package/dist/server/actions/getClientOrigin.js +16 -0
  151. package/dist/server/actions/getClientOrigin.js.map +1 -0
  152. package/dist/server/actions/getSessionId.d.ts.map +1 -0
  153. package/dist/{getSessionId-Ctmvpfgp.js → server/actions/getSessionId.js} +8 -5
  154. package/dist/server/actions/getSessionId.js.map +1 -0
  155. package/dist/server/actions/getSessionPayload.d.ts.map +1 -0
  156. package/dist/server/actions/getSessionPayload.js +27 -0
  157. package/dist/server/actions/getSessionPayload.js.map +1 -0
  158. package/dist/server/actions/getUserAction.d.ts.map +1 -0
  159. package/dist/server/actions/getUserAction.js +30 -0
  160. package/dist/server/actions/getUserAction.js.map +1 -0
  161. package/dist/server/actions/getUserProfileAction.d.ts.map +1 -0
  162. package/dist/server/actions/getUserProfileAction.js +34 -0
  163. package/dist/server/actions/getUserProfileAction.js.map +1 -0
  164. package/dist/server/actions/handleOAuthCallbackAction.d.ts.map +1 -0
  165. package/dist/server/actions/handleOAuthCallbackAction.js +87 -0
  166. package/dist/server/actions/handleOAuthCallbackAction.js.map +1 -0
  167. package/dist/server/actions/isSignedIn.d.ts.map +1 -0
  168. package/dist/server/actions/isSignedIn.js +40 -0
  169. package/dist/server/actions/isSignedIn.js.map +1 -0
  170. package/dist/server/actions/refreshToken.d.ts.map +1 -0
  171. package/dist/server/actions/refreshToken.js +58 -0
  172. package/dist/server/actions/refreshToken.js.map +1 -0
  173. package/dist/{types/server → server}/actions/signInAction.d.ts +3 -3
  174. package/dist/server/actions/signInAction.d.ts.map +1 -0
  175. package/dist/server/actions/signInAction.js +92 -0
  176. package/dist/server/actions/signInAction.js.map +1 -0
  177. package/dist/server/actions/signOutAction.d.ts.map +1 -0
  178. package/dist/server/actions/signOutAction.js +55 -0
  179. package/dist/server/actions/signOutAction.js.map +1 -0
  180. package/dist/{types/server/actions/getMyOrganizations.d.ts → server/actions/signUpAction.d.ts} +10 -5
  181. package/dist/server/actions/signUpAction.d.ts.map +1 -0
  182. package/dist/server/actions/signUpAction.js +27 -0
  183. package/dist/server/actions/signUpAction.js.map +1 -0
  184. package/dist/server/actions/updateUserProfileAction.d.ts.map +1 -0
  185. package/dist/server/actions/updateUserProfileAction.js +30 -0
  186. package/dist/server/actions/updateUserProfileAction.js.map +1 -0
  187. package/dist/server/getClient.d.ts.map +1 -0
  188. package/dist/server/getClient.js +19 -0
  189. package/dist/server/getClient.js.map +1 -0
  190. package/dist/{types/server → server}/index.d.ts +3 -0
  191. package/dist/server/index.d.ts.map +1 -0
  192. package/dist/server/index.js +6 -0
  193. package/dist/server/proxy/createRouteMatcher.d.ts.map +1 -0
  194. package/dist/server/proxy/createRouteMatcher.js +35 -0
  195. package/dist/server/proxy/createRouteMatcher.js.map +1 -0
  196. package/dist/{types/server/middleware/thunderIDMiddleware.d.ts → server/proxy/thunderIDProxy.d.ts} +13 -13
  197. package/dist/server/proxy/thunderIDProxy.d.ts.map +1 -0
  198. package/dist/server/proxy/thunderIDProxy.js +180 -0
  199. package/dist/server/proxy/thunderIDProxy.js.map +1 -0
  200. package/dist/server/thunderid.d.ts.map +1 -0
  201. package/dist/server/thunderid.js +27 -0
  202. package/dist/server/thunderid.js.map +1 -0
  203. package/dist/utils/SessionManager.d.ts.map +1 -0
  204. package/dist/utils/SessionManager.js +147 -0
  205. package/dist/utils/SessionManager.js.map +1 -0
  206. package/dist/utils/createRouteMatcher.d.ts.map +1 -0
  207. package/dist/utils/decorateConfigWithNextEnv.d.ts.map +1 -0
  208. package/dist/utils/decorateConfigWithNextEnv.js +27 -0
  209. package/dist/utils/decorateConfigWithNextEnv.js.map +1 -0
  210. package/dist/utils/handleRefreshToken.d.ts.map +1 -0
  211. package/dist/utils/handleRefreshToken.js +62 -0
  212. package/dist/utils/handleRefreshToken.js.map +1 -0
  213. package/dist/utils/logger.d.ts.map +1 -0
  214. package/dist/utils/logger.js +9 -0
  215. package/dist/utils/logger.js.map +1 -0
  216. package/dist/utils/sessionUtils.d.ts.map +1 -0
  217. package/dist/utils/sessionUtils.js +39 -0
  218. package/dist/utils/sessionUtils.js.map +1 -0
  219. package/package.json +12 -22
  220. package/dist/SessionManager-BPpyyzfa.js +0 -1384
  221. package/dist/cache-B9tFVOO5.js +0 -8047
  222. package/dist/cjs/SessionManager-SBxwYnwV.js +0 -1397
  223. package/dist/cjs/cache-0QwhuLuy.js +0 -8050
  224. package/dist/cjs/dynamic-rendering-W7rdgerZ.js +0 -1540
  225. package/dist/cjs/getAccessToken-EiHUciAb.js +0 -22
  226. package/dist/cjs/getSessionId-BUDHvxX2.js +0 -5
  227. package/dist/cjs/getSessionId-Do242Vmz.js +0 -28
  228. package/dist/cjs/index2.cjs +0 -8
  229. package/dist/cjs/middleware.cjs +0 -5151
  230. package/dist/cjs/segment-CPZPzHDj.js +0 -52
  231. package/dist/cjs/server-BAGHs6kk.js +0 -2468
  232. package/dist/dynamic-rendering-CkPpk5pF.js +0 -1441
  233. package/dist/getSessionId-pG-rZbaH.js +0 -5
  234. package/dist/index2.js +0 -7
  235. package/dist/middleware.js +0 -5152
  236. package/dist/segment-D3vdYYI5.js +0 -47
  237. package/dist/server-Bn2BrWaL.js +0 -2418
  238. package/dist/types/ThunderIDNextClient.d.ts.map +0 -1
  239. package/dist/types/client/components/actions/SignInButton/SignInButton.d.ts.map +0 -1
  240. package/dist/types/client/components/actions/SignOutButton/SignOutButton.d.ts.map +0 -1
  241. package/dist/types/client/components/actions/SignUpButton/SignUpButton.d.ts.map +0 -1
  242. package/dist/types/client/components/control/Loading/Loading.d.ts.map +0 -1
  243. package/dist/types/client/components/control/SignedIn/SignedIn.d.ts.map +0 -1
  244. package/dist/types/client/components/control/SignedOut/SignedOut.d.ts.map +0 -1
  245. package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts +0 -68
  246. package/dist/types/client/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +0 -1
  247. package/dist/types/client/components/presentation/Organization/Organization.d.ts +0 -67
  248. package/dist/types/client/components/presentation/Organization/Organization.d.ts.map +0 -1
  249. package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts +0 -93
  250. package/dist/types/client/components/presentation/OrganizationList/OrganizationList.d.ts.map +0 -1
  251. package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +0 -120
  252. package/dist/types/client/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +0 -1
  253. package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +0 -72
  254. package/dist/types/client/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +0 -1
  255. package/dist/types/client/components/presentation/SignIn/SignIn.d.ts.map +0 -1
  256. package/dist/types/client/components/presentation/SignUp/SignUp.d.ts.map +0 -1
  257. package/dist/types/client/components/presentation/User/User.d.ts.map +0 -1
  258. package/dist/types/client/components/presentation/UserDropdown/UserDropdown.d.ts.map +0 -1
  259. package/dist/types/client/components/presentation/UserProfile/UserProfile.d.ts.map +0 -1
  260. package/dist/types/client/contexts/ThunderID/ThunderIDContext.d.ts.map +0 -1
  261. package/dist/types/client/contexts/ThunderID/ThunderIDProvider.d.ts.map +0 -1
  262. package/dist/types/client/contexts/ThunderID/useThunderID.d.ts.map +0 -1
  263. package/dist/types/client/index.d.ts.map +0 -1
  264. package/dist/types/configs/InternalAuthAPIRoutesConfig.d.ts.map +0 -1
  265. package/dist/types/constants/sessionConstants.d.ts.map +0 -1
  266. package/dist/types/index.d.ts.map +0 -1
  267. package/dist/types/middleware.d.ts +0 -35
  268. package/dist/types/middleware.d.ts.map +0 -1
  269. package/dist/types/models/api.d.ts.map +0 -1
  270. package/dist/types/models/config.d.ts.map +0 -1
  271. package/dist/types/server/ThunderIDProvider.d.ts.map +0 -1
  272. package/dist/types/server/actions/clearSession.d.ts.map +0 -1
  273. package/dist/types/server/actions/createOrganization.d.ts +0 -24
  274. package/dist/types/server/actions/createOrganization.d.ts.map +0 -1
  275. package/dist/types/server/actions/getAccessToken.d.ts.map +0 -1
  276. package/dist/types/server/actions/getAllOrganizations.d.ts +0 -24
  277. package/dist/types/server/actions/getAllOrganizations.d.ts.map +0 -1
  278. package/dist/types/server/actions/getBrandingPreference.d.ts +0 -24
  279. package/dist/types/server/actions/getBrandingPreference.d.ts.map +0 -1
  280. package/dist/types/server/actions/getClientOrigin.d.ts.map +0 -1
  281. package/dist/types/server/actions/getCurrentOrganizationAction.d.ts +0 -31
  282. package/dist/types/server/actions/getCurrentOrganizationAction.d.ts.map +0 -1
  283. package/dist/types/server/actions/getMyOrganizations.d.ts.map +0 -1
  284. package/dist/types/server/actions/getOrganizationAction.d.ts +0 -31
  285. package/dist/types/server/actions/getOrganizationAction.d.ts.map +0 -1
  286. package/dist/types/server/actions/getSessionId.d.ts.map +0 -1
  287. package/dist/types/server/actions/getSessionPayload.d.ts.map +0 -1
  288. package/dist/types/server/actions/getUserAction.d.ts.map +0 -1
  289. package/dist/types/server/actions/getUserProfileAction.d.ts.map +0 -1
  290. package/dist/types/server/actions/handleOAuthCallbackAction.d.ts.map +0 -1
  291. package/dist/types/server/actions/isSignedIn.d.ts.map +0 -1
  292. package/dist/types/server/actions/refreshToken.d.ts.map +0 -1
  293. package/dist/types/server/actions/signInAction.d.ts.map +0 -1
  294. package/dist/types/server/actions/signOutAction.d.ts.map +0 -1
  295. package/dist/types/server/actions/signUpAction.d.ts +0 -36
  296. package/dist/types/server/actions/signUpAction.d.ts.map +0 -1
  297. package/dist/types/server/actions/switchOrganization.d.ts +0 -24
  298. package/dist/types/server/actions/switchOrganization.d.ts.map +0 -1
  299. package/dist/types/server/actions/updateUserProfileAction.d.ts.map +0 -1
  300. package/dist/types/server/getClient.d.ts.map +0 -1
  301. package/dist/types/server/index.d.ts.map +0 -1
  302. package/dist/types/server/middleware/createRouteMatcher.d.ts.map +0 -1
  303. package/dist/types/server/middleware/thunderIDMiddleware.d.ts.map +0 -1
  304. package/dist/types/server/thunderid.d.ts.map +0 -1
  305. package/dist/types/utils/SessionManager.d.ts.map +0 -1
  306. package/dist/types/utils/createRouteMatcher.d.ts.map +0 -1
  307. package/dist/types/utils/decorateConfigWithNextEnv.d.ts.map +0 -1
  308. package/dist/types/utils/handleRefreshToken.d.ts.map +0 -1
  309. package/dist/types/utils/logger.d.ts.map +0 -1
  310. package/dist/types/utils/sessionUtils.d.ts.map +0 -1
  311. /package/dist/{types/client → client}/components/actions/SignInButton/SignInButton.d.ts +0 -0
  312. /package/dist/{types/client → client}/components/actions/SignOutButton/SignOutButton.d.ts +0 -0
  313. /package/dist/{types/client → client}/components/actions/SignUpButton/SignUpButton.d.ts +0 -0
  314. /package/dist/{types/client → client}/components/control/Loading/Loading.d.ts +0 -0
  315. /package/dist/{types/client → client}/components/control/SignedIn/SignedIn.d.ts +0 -0
  316. /package/dist/{types/client → client}/components/control/SignedOut/SignedOut.d.ts +0 -0
  317. /package/dist/{types/client → client}/components/presentation/SignUp/SignUp.d.ts +0 -0
  318. /package/dist/{types/client → client}/components/presentation/User/User.d.ts +0 -0
  319. /package/dist/{types/client → client}/components/presentation/UserDropdown/UserDropdown.d.ts +0 -0
  320. /package/dist/{types/client → client}/components/presentation/UserProfile/UserProfile.d.ts +0 -0
  321. /package/dist/{types/client → client}/contexts/ThunderID/ThunderIDContext.d.ts +0 -0
  322. /package/dist/{types/client → client}/contexts/ThunderID/useThunderID.d.ts +0 -0
  323. /package/dist/{types/configs → configs}/InternalAuthAPIRoutesConfig.d.ts +0 -0
  324. /package/dist/{types/constants → constants}/sessionConstants.d.ts +0 -0
  325. /package/dist/{types/index.d.ts → index.d.ts} +0 -0
  326. /package/dist/{types/models → models}/api.d.ts +0 -0
  327. /package/dist/{types/models → models}/config.d.ts +0 -0
  328. /package/dist/{types/server → server}/ThunderIDProvider.d.ts +0 -0
  329. /package/dist/{types/server → server}/actions/clearSession.d.ts +0 -0
  330. /package/dist/{types/server → server}/actions/getAccessToken.d.ts +0 -0
  331. /package/dist/{types/server → server}/actions/getClientOrigin.d.ts +0 -0
  332. /package/dist/{types/server → server}/actions/getSessionId.d.ts +0 -0
  333. /package/dist/{types/server → server}/actions/getSessionPayload.d.ts +0 -0
  334. /package/dist/{types/server → server}/actions/getUserAction.d.ts +0 -0
  335. /package/dist/{types/server → server}/actions/getUserProfileAction.d.ts +0 -0
  336. /package/dist/{types/server → server}/actions/handleOAuthCallbackAction.d.ts +0 -0
  337. /package/dist/{types/server → server}/actions/isSignedIn.d.ts +0 -0
  338. /package/dist/{types/server → server}/actions/refreshToken.d.ts +0 -0
  339. /package/dist/{types/server → server}/actions/signOutAction.d.ts +0 -0
  340. /package/dist/{types/server → server}/actions/updateUserProfileAction.d.ts +0 -0
  341. /package/dist/{types/server → server}/getClient.d.ts +0 -0
  342. /package/dist/{types/server/middleware → server/proxy}/createRouteMatcher.d.ts +0 -0
  343. /package/dist/{types/server → server}/thunderid.d.ts +0 -0
  344. /package/dist/{types/utils → utils}/SessionManager.d.ts +0 -0
  345. /package/dist/{types/utils → utils}/createRouteMatcher.d.ts +0 -0
  346. /package/dist/{types/utils → utils}/decorateConfigWithNextEnv.d.ts +0 -0
  347. /package/dist/{types/utils → utils}/handleRefreshToken.d.ts +0 -0
  348. /package/dist/{types/utils → utils}/logger.d.ts +0 -0
  349. /package/dist/{types/utils → utils}/sessionUtils.d.ts +0 -0
@@ -0,0 +1,159 @@
1
+ 'use client';
2
+
3
+
4
+ import logger_default from "../../../utils/logger.js";
5
+ import ThunderIDContext_default from "./ThunderIDContext.js";
6
+ import { ThunderIDRuntimeError, generateFlattenedUserProfile } from "@thunderid/node";
7
+ import { FlowMetaProvider, FlowProvider, I18nProvider, ThemeProvider, UserProvider, getActiveTheme } from "@thunderid/react";
8
+ import { useRouter, useSearchParams } from "next/navigation";
9
+ import { useEffect, useMemo, useRef, useState } from "react";
10
+ import { jsx } from "react/jsx-runtime";
11
+
12
+ //#region src/client/contexts/ThunderID/ThunderIDProvider.tsx
13
+ const ThunderIDClientProvider = ({ baseUrl, children, signIn, clearSession, refreshToken, signOut, signUp, handleOAuthCallback, preferences, isSignedIn, signInUrl, signUpUrl, user: _user, userProfile: _userProfile, updateProfile, applicationId, organizationHandle, scopes }) => {
14
+ const reRenderCheckRef = useRef(false);
15
+ const router = useRouter();
16
+ const searchParams = useSearchParams();
17
+ const [isLoading, setIsLoading] = useState(true);
18
+ const [user, setUser] = useState(_user);
19
+ const [userProfile, setUserProfile] = useState(_userProfile);
20
+ useEffect(() => {
21
+ setUserProfile(_userProfile);
22
+ }, [_userProfile]);
23
+ useEffect(() => {
24
+ setUser(_user);
25
+ }, [_user]);
26
+ useEffect(() => {
27
+ if (reRenderCheckRef.current) return;
28
+ reRenderCheckRef.current = true;
29
+ if (isSignedIn) return;
30
+ (async () => {
31
+ try {
32
+ const code = searchParams.get("code");
33
+ const state = searchParams.get("state");
34
+ const sessionState = searchParams.get("session_state");
35
+ if (searchParams.get("error")) {
36
+ logger_default.error("[ThunderIDClientProvider] An error was received for the initiated sign-in request.");
37
+ return;
38
+ }
39
+ if (code && state) {
40
+ setIsLoading(true);
41
+ const result = await handleOAuthCallback(code, state, sessionState || void 0);
42
+ if (result.success) if (result.redirectUrl) router.push(result.redirectUrl);
43
+ else window.location.reload();
44
+ else logger_default.error(`[ThunderIDClientProvider] An error occurred while signing in: ${result.error || "Authentication failed"}`);
45
+ }
46
+ } catch (error) {
47
+ logger_default.error("[ThunderIDClientProvider] Failed to handle OAuth callback:", error);
48
+ }
49
+ })();
50
+ }, []);
51
+ useEffect(() => {
52
+ setIsLoading(false);
53
+ }, [isSignedIn, user]);
54
+ const handleSignIn = async (payload, request) => {
55
+ if (!signIn) throw new ThunderIDRuntimeError("`signIn` function is not available.", "ThunderIDClientProvider-handleSignIn-RuntimeError-001", "nextjs");
56
+ const result = await signIn(payload, request);
57
+ if (result?.data?.signInUrl) {
58
+ window.location.href = result.data.signInUrl;
59
+ return;
60
+ }
61
+ if (result?.data?.afterSignInUrl) {
62
+ router.push(result.data.afterSignInUrl);
63
+ return;
64
+ }
65
+ if (result?.error) throw new Error(result.error);
66
+ return result?.data ?? result;
67
+ };
68
+ const handleSignUp = async (payload, request) => {
69
+ if (!signUp) throw new ThunderIDRuntimeError("`signUp` function is not available.", "ThunderIDClientProvider-handleSignUp-RuntimeError-001", "nextjs");
70
+ const result = await signUp(payload, request);
71
+ if (result?.data?.signUpUrl) {
72
+ router.push(result.data.signUpUrl);
73
+ return;
74
+ }
75
+ if (result?.data?.afterSignUpUrl) {
76
+ router.push(result.data.afterSignUpUrl);
77
+ return;
78
+ }
79
+ if (result?.error) throw new Error(result.error);
80
+ return result?.data ?? result;
81
+ };
82
+ const handleSignOut = async () => {
83
+ logger_default.debug("[ThunderIDClientProvider][handleSignOut] `handleSignOut` called.");
84
+ try {
85
+ const result = await signOut();
86
+ logger_default.debug("[ThunderIDClientProvider][handleSignOut] Sign out result:", result);
87
+ if (result?.data?.afterSignOutUrl) {
88
+ router.push(result.data.afterSignOutUrl);
89
+ return {
90
+ location: result.data.afterSignOutUrl,
91
+ redirected: true
92
+ };
93
+ }
94
+ if (result?.error) logger_default.error("[ThunderIDClientProvider][handleSignOut] Error result was returned during signing the user out with a button click:", result.error);
95
+ return result?.data ?? result;
96
+ } catch (error) {
97
+ logger_default.error("[ThunderIDClientProvider][handleSignOut] Error occurred during signing the user out with a button click:", error);
98
+ return;
99
+ }
100
+ };
101
+ const contextValue = useMemo(() => ({
102
+ applicationId,
103
+ baseUrl,
104
+ clearSession,
105
+ isLoading,
106
+ isSignedIn,
107
+ organizationHandle,
108
+ refreshToken,
109
+ scopes,
110
+ signIn: handleSignIn,
111
+ signInUrl,
112
+ signOut: handleSignOut,
113
+ signUp: handleSignUp,
114
+ signUpUrl,
115
+ user
116
+ }), [
117
+ baseUrl,
118
+ user,
119
+ isSignedIn,
120
+ isLoading,
121
+ signInUrl,
122
+ signUpUrl,
123
+ applicationId,
124
+ organizationHandle,
125
+ scopes
126
+ ]);
127
+ const handleProfileUpdate = (payload) => {
128
+ setUser(payload);
129
+ setUserProfile((prev) => ({
130
+ ...prev,
131
+ flattenedProfile: generateFlattenedUserProfile(payload, prev?.schemas),
132
+ profile: payload
133
+ }));
134
+ };
135
+ return /* @__PURE__ */ jsx(ThunderIDContext_default.Provider, {
136
+ value: contextValue,
137
+ children: /* @__PURE__ */ jsx(I18nProvider, {
138
+ preferences: preferences?.i18n,
139
+ children: /* @__PURE__ */ jsx(FlowMetaProvider, {
140
+ enabled: preferences?.resolveFromMeta !== false,
141
+ children: /* @__PURE__ */ jsx(ThemeProvider, {
142
+ theme: preferences?.theme?.overrides,
143
+ mode: getActiveTheme(preferences?.theme?.mode),
144
+ children: /* @__PURE__ */ jsx(FlowProvider, { children: /* @__PURE__ */ jsx(UserProvider, {
145
+ profile: userProfile,
146
+ onUpdateProfile: handleProfileUpdate,
147
+ updateProfile,
148
+ children
149
+ }) })
150
+ })
151
+ })
152
+ })
153
+ });
154
+ };
155
+ var ThunderIDProvider_default = ThunderIDClientProvider;
156
+
157
+ //#endregion
158
+ export { ThunderIDProvider_default as default };
159
+ //# sourceMappingURL=ThunderIDProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ThunderIDProvider.js","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}","result: any","contextValue: ThunderIDContextProps","ThunderIDContext"],"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 @@
1
+ {"version":3,"file":"useThunderID.d.ts","sourceRoot":"","sources":["../../../../src/client/contexts/ThunderID/useThunderID.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAKH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAE3E,QAAA,MAAM,YAAY,QAAO,qBAQxB,CAAC;AAEF,eAAe,YAAY,CAAC"}
@@ -0,0 +1,17 @@
1
+ 'use client';
2
+
3
+
4
+ import ThunderIDContext_default from "./ThunderIDContext.js";
5
+ import { useContext } from "react";
6
+
7
+ //#region src/client/contexts/ThunderID/useThunderID.ts
8
+ const useThunderID = () => {
9
+ const context = useContext(ThunderIDContext_default);
10
+ if (!context) throw new Error("useThunderID must be used within an ThunderIDProvider");
11
+ return context;
12
+ };
13
+ var useThunderID_default = useThunderID;
14
+
15
+ //#endregion
16
+ export { useThunderID_default as default };
17
+ //# sourceMappingURL=useThunderID.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useThunderID.js","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,UAAwC,WAAWC,yBAAiB;AAE1E,KAAI,CAAC,QACH,OAAM,IAAI,MAAM,wDAAwD;AAG1E,QAAO;;AAGT,2BAAe"}
@@ -16,18 +16,10 @@
16
16
  * under the License.
17
17
  */
18
18
  export { default as useThunderID } from './contexts/ThunderID/useThunderID';
19
- export { default as Organization } from './components/presentation/Organization/Organization';
20
- export { OrganizationProps } from './components/presentation/Organization/Organization';
21
- export { default as CreateOrganization } from './components/presentation/CreateOrganization/CreateOrganization';
22
- export { CreateOrganizationProps } from './components/presentation/CreateOrganization/CreateOrganization';
23
- export { default as OrganizationProfile } from './components/presentation/OrganizationProfile/OrganizationProfile';
24
- export { OrganizationProfileProps } from './components/presentation/OrganizationProfile/OrganizationProfile';
25
- export { default as OrganizationSwitcher } from './components/presentation/OrganizationSwitcher/OrganizationSwitcher';
26
- export { OrganizationSwitcherProps } from './components/presentation/OrganizationSwitcher/OrganizationSwitcher';
27
19
  export { default as SignedIn } from './components/control/SignedIn/SignedIn';
28
- export { SignedInProps } from './components/control/SignedIn/SignedIn';
20
+ export type { SignedInProps } from './components/control/SignedIn/SignedIn';
29
21
  export { default as SignedOut } from './components/control/SignedOut/SignedOut';
30
- export { SignedOutProps } from './components/control/SignedOut/SignedOut';
22
+ export type { SignedOutProps } from './components/control/SignedOut/SignedOut';
31
23
  export { default as SignInButton } from './components/actions/SignInButton/SignInButton';
32
24
  export type { SignInButtonProps } from './components/actions/SignInButton/SignInButton';
33
25
  export { default as SignUpButton } from './components/actions/SignUpButton/SignUpButton';
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/client/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAE1E,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,wCAAwC,CAAC;AAC3E,YAAY,EAAC,aAAa,EAAC,MAAM,wCAAwC,CAAC;AAE1E,OAAO,EAAC,OAAO,IAAI,SAAS,EAAC,MAAM,0CAA0C,CAAC;AAC9E,YAAY,EAAC,cAAc,EAAC,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gDAAgD,CAAC;AACvF,YAAY,EAAC,iBAAiB,EAAC,MAAM,gDAAgD,CAAC;AAEtF,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,gDAAgD,CAAC;AACvF,YAAY,EAAC,iBAAiB,EAAC,MAAM,gDAAgD,CAAC;AAEtF,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,yCAAyC,CAAC;AAC1E,YAAY,EAAC,WAAW,EAAC,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,kDAAkD,CAAC;AAC1F,YAAY,EAAC,kBAAkB,EAAC,MAAM,kDAAkD,CAAC;AAEzF,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,qCAAqC,CAAC;AACpE,YAAY,EAAC,SAAS,EAAC,MAAM,qCAAqC,CAAC;AAEnE,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,yCAAyC,CAAC;AAC1E,YAAY,EAAC,WAAW,EAAC,MAAM,yCAAyC,CAAC;AAEzE,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,qDAAqD,CAAC;AAC5F,YAAY,EAAC,iBAAiB,EAAC,MAAM,qDAAqD,CAAC;AAE3F,OAAO,EAAC,OAAO,IAAI,WAAW,EAAC,MAAM,mDAAmD,CAAC;AACzF,YAAY,EAAC,gBAAgB,EAAC,MAAM,mDAAmD,CAAC"}
@@ -0,0 +1,13 @@
1
+ import useThunderID_default from "./contexts/ThunderID/useThunderID.js";
2
+ import SignedIn_default from "./components/control/SignedIn/SignedIn.js";
3
+ import SignedOut_default from "./components/control/SignedOut/SignedOut.js";
4
+ import SignInButton_default from "./components/actions/SignInButton/SignInButton.js";
5
+ import SignUpButton_default from "./components/actions/SignUpButton/SignUpButton.js";
6
+ import SignIn_default from "./components/presentation/SignIn/SignIn.js";
7
+ import SignOutButton_default from "./components/actions/SignOutButton/SignOutButton.js";
8
+ import User_default from "./components/presentation/User/User.js";
9
+ import SignUp_default from "./components/presentation/SignUp/SignUp.js";
10
+ import UserProfile_default from "./components/presentation/UserProfile/UserProfile.js";
11
+ import UserDropdown_default from "./components/presentation/UserDropdown/UserDropdown.js";
12
+
13
+ export { };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"InternalAuthAPIRoutesConfig.d.ts","sourceRoot":"","sources":["../../src/configs/InternalAuthAPIRoutesConfig.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,qBAAqB,EAAC,MAAM,eAAe,CAAC;AAEpD,QAAA,MAAM,2BAA2B,EAAE,qBAMlC,CAAC;AAEF,eAAe,2BAA2B,CAAC"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionConstants.d.ts","sourceRoot":"","sources":["../../src/constants/sessionConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,eAAO,MAAM,kCAAkC,QAAQ,CAAC"}
@@ -0,0 +1,53 @@
1
+ //#region src/constants/sessionConstants.ts
2
+ /**
3
+ * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
4
+ *
5
+ * WSO2 LLC. licenses this file to you under the Apache License,
6
+ * Version 2.0 (the "License"); you may not use this file except
7
+ * in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing,
13
+ * software distributed under the License is distributed on an
14
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15
+ * KIND, either express or implied. See the License for the
16
+ * specific language governing permissions and limitations
17
+ * under the License.
18
+ */
19
+ /**
20
+ * Number of seconds before access token expiry at which the SDK proactively
21
+ * refreshes the token. A 25-second buffer prevents races where the token is
22
+ * valid when a request starts but expires mid-flight.
23
+ */
24
+ const REFRESH_BUFFER_SECONDS = 25;
25
+ /**
26
+ * Default session cookie lifetime in seconds (24 hours).
27
+ *
28
+ * Used when no explicit session cookie expiry is configured. The session cookie
29
+ * lifetime can be overridden in two ways (evaluated in this order):
30
+ *
31
+ * 1. `sessionCookie.expiryTime` in `ThunderIDNodeConfig` — set programmatically
32
+ * when initialising the SDK.
33
+ * 2. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME` environment variable — set in `.env`
34
+ * (e.g. `THUNDERID_SESSION_COOKIE_EXPIRY_TIME=86400`).
35
+ * 3. This constant — applied when neither of the above is present.
36
+ *
37
+ * Two independent expiry bounds apply to the session and they are generally
38
+ * NOT the same value:
39
+ *
40
+ * - JWT `exp` claim — set by `SessionManager.createSessionToken(...)` from
41
+ * the `accessTokenTtlSeconds` argument (i.e. the access token's `expires_in`
42
+ * returned by the auth server, typically ~1 hour). This controls when
43
+ * `verifySessionToken` rejects the token and is the trigger for a refresh.
44
+ * - Browser cookie `maxAge` — set by the caller (sign-in / refresh / org-switch
45
+ * actions) from `SessionManager.resolveSessionCookieExpiry(...)`, which returns
46
+ * this constant by default (24 hours). This controls how long the browser
47
+ * holds the cookie before discarding it.
48
+ */
49
+ const DEFAULT_SESSION_COOKIE_EXPIRY_TIME = 86400;
50
+
51
+ //#endregion
52
+ export { DEFAULT_SESSION_COOKIE_EXPIRY_TIME, REFRESH_BUFFER_SECONDS };
53
+ //# sourceMappingURL=sessionConstants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sessionConstants.js","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"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,OAAO,IAAI,aAAa,EAAC,MAAM,uBAAuB,CAAC;AAG/D,cAAc,UAAU,CAAC;AAGzB,cAAc,UAAU,CAAC"}