@civic/auth 0.0.1-beta.27 → 0.0.1-beta.28

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 (559) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/dist/cjs/src/server/login.d.ts +1 -1
  3. package/dist/cjs/src/server/login.d.ts.map +1 -1
  4. package/dist/cjs/src/server/login.js.map +1 -1
  5. package/dist/cjs/src/shared/components/LoadingIcon.d.ts.map +1 -1
  6. package/dist/cjs/src/shared/components/LoadingIcon.js +6 -0
  7. package/dist/cjs/src/shared/components/LoadingIcon.js.map +1 -1
  8. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  9. package/dist/esm/src/server/login.d.ts +1 -1
  10. package/dist/esm/src/server/login.d.ts.map +1 -1
  11. package/dist/esm/src/server/login.js.map +1 -1
  12. package/dist/esm/src/shared/components/LoadingIcon.d.ts.map +1 -1
  13. package/dist/esm/src/shared/components/LoadingIcon.js +6 -0
  14. package/dist/esm/src/shared/components/LoadingIcon.js.map +1 -1
  15. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  16. package/dist/src/nextjs/index.d.ts +1 -1
  17. package/dist/src/nextjs/index.d.ts.map +1 -1
  18. package/dist/src/nextjs/index.js +1 -1
  19. package/dist/src/nextjs/index.js.map +1 -1
  20. package/dist/src/shared/components/LoadingIcon.d.ts.map +1 -1
  21. package/dist/src/shared/components/LoadingIcon.js +6 -0
  22. package/dist/src/shared/components/LoadingIcon.js.map +1 -1
  23. package/dist/tsconfig.tsbuildinfo +1 -1
  24. package/package.json +1 -1
  25. package/src/server/login.ts +6 -5
  26. package/src/shared/components/LoadingIcon.tsx +8 -0
  27. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/browser/storage.d.ts +0 -6
  28. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/browser/storage.d.ts.map +0 -1
  29. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/browser/storage.js +0 -13
  30. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/browser/storage.js.map +0 -1
  31. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/config.d.ts +0 -3
  32. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/config.d.ts.map +0 -1
  33. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/config.js +0 -8
  34. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/config.js.map +0 -1
  35. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/constants.d.ts +0 -9
  36. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/constants.d.ts.map +0 -1
  37. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/constants.js +0 -26
  38. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/constants.js.map +0 -1
  39. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/index.d.ts +0 -5
  40. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/index.d.ts.map +0 -1
  41. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/index.js +0 -5
  42. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/index.js.map +0 -1
  43. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/cookies.d.ts +0 -7
  44. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/cookies.d.ts.map +0 -1
  45. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/cookies.js +0 -26
  46. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/cookies.js.map +0 -1
  47. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/jwt.d.ts +0 -3
  48. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/jwt.d.ts.map +0 -1
  49. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/jwt.js +0 -13
  50. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/jwt.js.map +0 -1
  51. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/logger.d.ts +0 -26
  52. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/logger.d.ts.map +0 -1
  53. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/logger.js +0 -60
  54. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/logger.js.map +0 -1
  55. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/oauth.d.ts +0 -19
  56. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/oauth.d.ts.map +0 -1
  57. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/oauth.js +0 -67
  58. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/oauth.js.map +0 -1
  59. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/postMessage.d.ts +0 -4
  60. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/postMessage.d.ts.map +0 -1
  61. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/postMessage.js +0 -18
  62. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/postMessage.js.map +0 -1
  63. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/windowUtil.d.ts +0 -4
  64. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/windowUtil.d.ts.map +0 -1
  65. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/windowUtil.js +0 -34
  66. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/lib/windowUtil.js.map +0 -1
  67. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/GetUser.d.ts +0 -6
  68. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/GetUser.d.ts.map +0 -1
  69. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/GetUser.js +0 -22
  70. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/GetUser.js.map +0 -1
  71. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/client/index.d.ts +0 -2
  72. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/client/index.d.ts.map +0 -1
  73. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/client/index.js +0 -6
  74. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/client/index.js.map +0 -1
  75. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/config.d.ts +0 -178
  76. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/config.d.ts.map +0 -1
  77. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/config.js +0 -169
  78. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/config.js.map +0 -1
  79. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/cookies.d.ts +0 -30
  80. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/cookies.d.ts.map +0 -1
  81. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/cookies.js +0 -116
  82. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/cookies.js.map +0 -1
  83. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/index.d.ts +0 -2
  84. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/index.d.ts.map +0 -1
  85. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/index.js +0 -6
  86. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/index.js.map +0 -1
  87. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useTokenCookie.d.ts +0 -3
  88. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useTokenCookie.d.ts.map +0 -1
  89. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useTokenCookie.js +0 -41
  90. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useTokenCookie.js.map +0 -1
  91. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useUserCookie.d.ts +0 -3
  92. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useUserCookie.d.ts.map +0 -1
  93. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useUserCookie.js +0 -40
  94. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/hooks/useUserCookie.js.map +0 -1
  95. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/index.d.ts +0 -7
  96. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/index.d.ts.map +0 -1
  97. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/index.js +0 -20
  98. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/index.js.map +0 -1
  99. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware/index.d.ts +0 -2
  100. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware/index.d.ts.map +0 -1
  101. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware/index.js +0 -8
  102. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware/index.js.map +0 -1
  103. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware.d.ts +0 -59
  104. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware.d.ts.map +0 -1
  105. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware.js +0 -114
  106. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/middleware.js.map +0 -1
  107. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/providers/NextAuthProvider.d.ts +0 -9
  108. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/providers/NextAuthProvider.d.ts.map +0 -1
  109. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/providers/NextAuthProvider.js +0 -54
  110. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/providers/NextAuthProvider.js.map +0 -1
  111. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/routeHandler.d.ts +0 -18
  112. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/routeHandler.d.ts.map +0 -1
  113. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/routeHandler.js +0 -221
  114. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/routeHandler.js.map +0 -1
  115. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/utils.d.ts +0 -3
  116. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/utils.d.ts.map +0 -1
  117. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/utils.js +0 -9
  118. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/nextjs/utils.js.map +0 -1
  119. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignInButton.d.ts +0 -8
  120. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignInButton.d.ts.map +0 -1
  121. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignInButton.js +0 -14
  122. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignInButton.js.map +0 -1
  123. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignOutButton.d.ts +0 -6
  124. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignOutButton.d.ts.map +0 -1
  125. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignOutButton.js +0 -14
  126. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/SignOutButton.js.map +0 -1
  127. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/UserButton.d.ts +0 -8
  128. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/UserButton.d.ts.map +0 -1
  129. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/UserButton.js +0 -62
  130. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/UserButton.js.map +0 -1
  131. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/index.d.ts +0 -6
  132. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/index.d.ts.map +0 -1
  133. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/index.js +0 -14
  134. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/components/index.js.map +0 -1
  135. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/index.d.ts +0 -9
  136. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/index.d.ts.map +0 -1
  137. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/index.js +0 -20
  138. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/index.js.map +0 -1
  139. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useAuth.d.ts +0 -3
  140. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useAuth.d.ts.map +0 -1
  141. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useAuth.js +0 -15
  142. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useAuth.js.map +0 -1
  143. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useUser.d.ts +0 -4
  144. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useUser.d.ts.map +0 -1
  145. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useUser.js +0 -15
  146. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/hooks/useUser.js.map +0 -1
  147. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/index.d.ts +0 -6
  148. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/index.d.ts.map +0 -1
  149. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/index.js +0 -17
  150. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/index.js.map +0 -1
  151. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/providers/index.d.ts +0 -8
  152. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/providers/index.d.ts.map +0 -1
  153. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/providers/index.js +0 -19
  154. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/reactjs/providers/index.js.map +0 -1
  155. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/ServerAuthenticationResolver.d.ts +0 -18
  156. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/ServerAuthenticationResolver.d.ts.map +0 -1
  157. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/ServerAuthenticationResolver.js +0 -66
  158. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/ServerAuthenticationResolver.js.map +0 -1
  159. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/config.d.ts +0 -16
  160. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/config.d.ts.map +0 -1
  161. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/config.js +0 -3
  162. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/config.js.map +0 -1
  163. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/index.d.ts +0 -6
  164. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/index.d.ts.map +0 -1
  165. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/index.js +0 -14
  166. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/index.js.map +0 -1
  167. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/login.d.ts +0 -17
  168. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/login.d.ts.map +0 -1
  169. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/login.js +0 -42
  170. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/login.js.map +0 -1
  171. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/refresh.d.ts +0 -7
  172. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/refresh.d.ts.map +0 -1
  173. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/refresh.js +0 -16
  174. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/server/refresh.js.map +0 -1
  175. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/AuthenticationService.d.ts +0 -87
  176. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/AuthenticationService.d.ts.map +0 -1
  177. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/AuthenticationService.js +0 -228
  178. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/AuthenticationService.js.map +0 -1
  179. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/PKCE.d.ts +0 -20
  180. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/PKCE.d.ts.map +0 -1
  181. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/PKCE.js +0 -50
  182. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/PKCE.js.map +0 -1
  183. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/types.d.ts +0 -23
  184. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/types.d.ts.map +0 -1
  185. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/types.js +0 -11
  186. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/services/types.js.map +0 -1
  187. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframe.d.ts +0 -8
  188. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframe.d.ts.map +0 -1
  189. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframe.js +0 -13
  190. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframe.js.map +0 -1
  191. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframeContainer.d.ts +0 -9
  192. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframeContainer.d.ts.map +0 -1
  193. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframeContainer.js +0 -96
  194. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CivicAuthIframeContainer.js.map +0 -1
  195. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CloseIcon.d.ts +0 -4
  196. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CloseIcon.d.ts.map +0 -1
  197. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CloseIcon.js +0 -10
  198. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/CloseIcon.js.map +0 -1
  199. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/LoadingIcon.d.ts +0 -4
  200. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/LoadingIcon.d.ts.map +0 -1
  201. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/LoadingIcon.js +0 -12
  202. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/components/LoadingIcon.js.map +0 -1
  203. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/index.d.ts +0 -5
  204. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/index.d.ts.map +0 -1
  205. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/index.js +0 -12
  206. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/index.js.map +0 -1
  207. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useAuth.d.ts +0 -3
  208. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useAuth.d.ts.map +0 -1
  209. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useAuth.js +0 -15
  210. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useAuth.js.map +0 -1
  211. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useConfig.d.ts +0 -3
  212. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useConfig.d.ts.map +0 -1
  213. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useConfig.js +0 -16
  214. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useConfig.js.map +0 -1
  215. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useIframe.d.ts +0 -3
  216. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useIframe.d.ts.map +0 -1
  217. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useIframe.js +0 -16
  218. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useIframe.js.map +0 -1
  219. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useSession.d.ts +0 -3
  220. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useSession.d.ts.map +0 -1
  221. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useSession.js +0 -16
  222. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useSession.js.map +0 -1
  223. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useToken.d.ts +0 -3
  224. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useToken.d.ts.map +0 -1
  225. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useToken.js +0 -15
  226. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/hooks/useToken.js.map +0 -1
  227. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.d.ts +0 -15
  228. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.d.ts.map +0 -1
  229. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.js +0 -47
  230. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.js.map +0 -1
  231. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/UserSession.d.ts +0 -12
  232. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/UserSession.d.ts.map +0 -1
  233. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/UserSession.js +0 -24
  234. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/UserSession.js.map +0 -1
  235. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/session.d.ts +0 -3
  236. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/session.d.ts.map +0 -1
  237. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/session.js +0 -13
  238. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/session.js.map +0 -1
  239. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/storage.d.ts +0 -25
  240. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/storage.d.ts.map +0 -1
  241. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/storage.js +0 -21
  242. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/storage.js.map +0 -1
  243. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/types.d.ts +0 -22
  244. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/types.d.ts.map +0 -1
  245. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/types.js +0 -19
  246. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/types.js.map +0 -1
  247. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/util.d.ts +0 -33
  248. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/util.d.ts.map +0 -1
  249. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/util.js +0 -142
  250. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/lib/util.js.map +0 -1
  251. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthContext.d.ts +0 -10
  252. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthContext.d.ts.map +0 -1
  253. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthContext.js +0 -6
  254. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthContext.js.map +0 -1
  255. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthProvider.d.ts +0 -20
  256. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthProvider.d.ts.map +0 -1
  257. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthProvider.js +0 -249
  258. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/AuthProvider.js.map +0 -1
  259. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/CivicAuthProvider.d.ts +0 -6
  260. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/CivicAuthProvider.d.ts.map +0 -1
  261. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/CivicAuthProvider.js +0 -19
  262. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/CivicAuthProvider.js.map +0 -1
  263. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/ConfigProvider.d.ts +0 -21
  264. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/ConfigProvider.d.ts.map +0 -1
  265. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/ConfigProvider.js +0 -24
  266. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/ConfigProvider.js.map +0 -1
  267. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/IframeProvider.d.ts +0 -16
  268. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/IframeProvider.d.ts.map +0 -1
  269. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/IframeProvider.js +0 -16
  270. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/IframeProvider.js.map +0 -1
  271. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/SessionProvider.d.ts +0 -13
  272. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/SessionProvider.d.ts.map +0 -1
  273. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/SessionProvider.js +0 -18
  274. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/SessionProvider.js.map +0 -1
  275. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/TokenProvider.d.ts +0 -18
  276. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/TokenProvider.d.ts.map +0 -1
  277. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/TokenProvider.js +0 -58
  278. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/TokenProvider.js.map +0 -1
  279. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/UserProvider.d.ts +0 -18
  280. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/UserProvider.d.ts.map +0 -1
  281. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/UserProvider.js +0 -43
  282. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/shared/providers/UserProvider.js.map +0 -1
  283. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/types.d.ts +0 -146
  284. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/types.d.ts.map +0 -1
  285. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/types.js +0 -3
  286. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/types.js.map +0 -1
  287. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/utils.d.ts +0 -17
  288. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/utils.d.ts.map +0 -1
  289. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/utils.js +0 -53
  290. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/src/utils.js.map +0 -1
  291. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/cjs/tsconfig.cjs.tsbuildinfo +0 -1
  292. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/browser/storage.d.ts +0 -6
  293. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/browser/storage.d.ts.map +0 -1
  294. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/browser/storage.js +0 -9
  295. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/browser/storage.js.map +0 -1
  296. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/config.d.ts +0 -3
  297. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/config.d.ts.map +0 -1
  298. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/config.js +0 -5
  299. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/config.js.map +0 -1
  300. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/constants.d.ts +0 -9
  301. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/constants.d.ts.map +0 -1
  302. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/constants.js +0 -17
  303. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/constants.js.map +0 -1
  304. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/index.d.ts +0 -5
  305. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/index.d.ts.map +0 -1
  306. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/index.js +0 -3
  307. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/index.js.map +0 -1
  308. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/cookies.d.ts +0 -7
  309. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/cookies.d.ts.map +0 -1
  310. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/cookies.js +0 -23
  311. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/cookies.js.map +0 -1
  312. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/jwt.d.ts +0 -3
  313. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/jwt.d.ts.map +0 -1
  314. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/jwt.js +0 -9
  315. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/jwt.js.map +0 -1
  316. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/logger.d.ts +0 -26
  317. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/logger.d.ts.map +0 -1
  318. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/logger.js +0 -55
  319. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/logger.js.map +0 -1
  320. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/oauth.d.ts +0 -19
  321. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/oauth.d.ts.map +0 -1
  322. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/oauth.js +0 -60
  323. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/oauth.js.map +0 -1
  324. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/postMessage.d.ts +0 -4
  325. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/postMessage.d.ts.map +0 -1
  326. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/postMessage.js +0 -15
  327. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/postMessage.js.map +0 -1
  328. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/windowUtil.d.ts +0 -4
  329. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/windowUtil.d.ts.map +0 -1
  330. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/windowUtil.js +0 -30
  331. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/lib/windowUtil.js.map +0 -1
  332. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/GetUser.d.ts +0 -6
  333. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/GetUser.d.ts.map +0 -1
  334. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/GetUser.js +0 -18
  335. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/GetUser.js.map +0 -1
  336. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/client/index.d.ts +0 -2
  337. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/client/index.d.ts.map +0 -1
  338. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/client/index.js +0 -2
  339. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/client/index.js.map +0 -1
  340. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/config.d.ts +0 -178
  341. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/config.d.ts.map +0 -1
  342. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/config.js +0 -164
  343. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/config.js.map +0 -1
  344. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/cookies.d.ts +0 -30
  345. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/cookies.d.ts.map +0 -1
  346. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/cookies.js +0 -109
  347. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/cookies.js.map +0 -1
  348. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/index.d.ts +0 -2
  349. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/index.d.ts.map +0 -1
  350. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/index.js +0 -2
  351. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/index.js.map +0 -1
  352. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useTokenCookie.d.ts +0 -3
  353. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useTokenCookie.d.ts.map +0 -1
  354. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useTokenCookie.js +0 -37
  355. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useTokenCookie.js.map +0 -1
  356. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useUserCookie.d.ts +0 -3
  357. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useUserCookie.d.ts.map +0 -1
  358. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useUserCookie.js +0 -36
  359. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/hooks/useUserCookie.js.map +0 -1
  360. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/index.d.ts +0 -7
  361. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/index.d.ts.map +0 -1
  362. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/index.js +0 -6
  363. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/index.js.map +0 -1
  364. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware/index.d.ts +0 -2
  365. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware/index.d.ts.map +0 -1
  366. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware/index.js +0 -2
  367. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware/index.js.map +0 -1
  368. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware.d.ts +0 -59
  369. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware.d.ts.map +0 -1
  370. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware.js +0 -107
  371. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/middleware.js.map +0 -1
  372. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/providers/NextAuthProvider.d.ts +0 -9
  373. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/providers/NextAuthProvider.d.ts.map +0 -1
  374. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/providers/NextAuthProvider.js +0 -50
  375. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/providers/NextAuthProvider.js.map +0 -1
  376. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/routeHandler.d.ts +0 -18
  377. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/routeHandler.d.ts.map +0 -1
  378. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/routeHandler.js +0 -216
  379. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/routeHandler.js.map +0 -1
  380. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/utils.d.ts +0 -3
  381. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/utils.d.ts.map +0 -1
  382. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/utils.js +0 -5
  383. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/nextjs/utils.js.map +0 -1
  384. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignInButton.d.ts +0 -8
  385. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignInButton.d.ts.map +0 -1
  386. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignInButton.js +0 -10
  387. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignInButton.js.map +0 -1
  388. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignOutButton.d.ts +0 -6
  389. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignOutButton.d.ts.map +0 -1
  390. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignOutButton.js +0 -10
  391. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/SignOutButton.js.map +0 -1
  392. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/UserButton.d.ts +0 -8
  393. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/UserButton.d.ts.map +0 -1
  394. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/UserButton.js +0 -58
  395. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/UserButton.js.map +0 -1
  396. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/index.d.ts +0 -6
  397. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/index.d.ts.map +0 -1
  398. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/index.js +0 -6
  399. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/components/index.js.map +0 -1
  400. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/index.d.ts +0 -9
  401. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/index.d.ts.map +0 -1
  402. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/index.js +0 -9
  403. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/index.js.map +0 -1
  404. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useAuth.d.ts +0 -3
  405. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useAuth.d.ts.map +0 -1
  406. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useAuth.js +0 -12
  407. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useAuth.js.map +0 -1
  408. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useUser.d.ts +0 -4
  409. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useUser.d.ts.map +0 -1
  410. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useUser.js +0 -12
  411. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/hooks/useUser.js.map +0 -1
  412. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/index.d.ts +0 -6
  413. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/index.d.ts.map +0 -1
  414. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/index.js +0 -8
  415. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/index.js.map +0 -1
  416. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/providers/index.d.ts +0 -8
  417. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/providers/index.d.ts.map +0 -1
  418. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/providers/index.js +0 -7
  419. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/reactjs/providers/index.js.map +0 -1
  420. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/ServerAuthenticationResolver.d.ts +0 -18
  421. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/ServerAuthenticationResolver.d.ts.map +0 -1
  422. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/ServerAuthenticationResolver.js +0 -62
  423. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/ServerAuthenticationResolver.js.map +0 -1
  424. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/config.d.ts +0 -16
  425. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/config.d.ts.map +0 -1
  426. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/config.js +0 -2
  427. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/config.js.map +0 -1
  428. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/index.d.ts +0 -6
  429. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/index.d.ts.map +0 -1
  430. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/index.js +0 -5
  431. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/index.js.map +0 -1
  432. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/login.d.ts +0 -17
  433. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/login.d.ts.map +0 -1
  434. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/login.js +0 -37
  435. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/login.js.map +0 -1
  436. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/refresh.d.ts +0 -7
  437. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/refresh.d.ts.map +0 -1
  438. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/refresh.js +0 -13
  439. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/server/refresh.js.map +0 -1
  440. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/AuthenticationService.d.ts +0 -87
  441. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/AuthenticationService.d.ts.map +0 -1
  442. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/AuthenticationService.js +0 -222
  443. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/AuthenticationService.js.map +0 -1
  444. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/PKCE.d.ts +0 -20
  445. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/PKCE.d.ts.map +0 -1
  446. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/PKCE.js +0 -44
  447. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/PKCE.js.map +0 -1
  448. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/types.d.ts +0 -23
  449. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/types.d.ts.map +0 -1
  450. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/types.js +0 -7
  451. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/services/types.js.map +0 -1
  452. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframe.d.ts +0 -8
  453. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframe.d.ts.map +0 -1
  454. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframe.js +0 -9
  455. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframe.js.map +0 -1
  456. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframeContainer.d.ts +0 -9
  457. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframeContainer.d.ts.map +0 -1
  458. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframeContainer.js +0 -92
  459. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CivicAuthIframeContainer.js.map +0 -1
  460. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CloseIcon.d.ts +0 -4
  461. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CloseIcon.d.ts.map +0 -1
  462. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CloseIcon.js +0 -6
  463. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/CloseIcon.js.map +0 -1
  464. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/LoadingIcon.d.ts +0 -4
  465. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/LoadingIcon.d.ts.map +0 -1
  466. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/LoadingIcon.js +0 -8
  467. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/components/LoadingIcon.js.map +0 -1
  468. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/index.d.ts +0 -5
  469. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/index.d.ts.map +0 -1
  470. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/index.js +0 -5
  471. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/index.js.map +0 -1
  472. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useAuth.d.ts +0 -3
  473. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useAuth.d.ts.map +0 -1
  474. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useAuth.js +0 -12
  475. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useAuth.js.map +0 -1
  476. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useConfig.d.ts +0 -3
  477. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useConfig.d.ts.map +0 -1
  478. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useConfig.js +0 -13
  479. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useConfig.js.map +0 -1
  480. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useIframe.d.ts +0 -3
  481. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useIframe.d.ts.map +0 -1
  482. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useIframe.js +0 -13
  483. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useIframe.js.map +0 -1
  484. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useSession.d.ts +0 -3
  485. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useSession.d.ts.map +0 -1
  486. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useSession.js +0 -13
  487. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useSession.js.map +0 -1
  488. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useToken.d.ts +0 -3
  489. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useToken.d.ts.map +0 -1
  490. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useToken.js +0 -12
  491. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/hooks/useToken.js.map +0 -1
  492. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/GenericAuthenticationRefresher.d.ts +0 -15
  493. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/GenericAuthenticationRefresher.d.ts.map +0 -1
  494. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/GenericAuthenticationRefresher.js +0 -43
  495. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/GenericAuthenticationRefresher.js.map +0 -1
  496. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/UserSession.d.ts +0 -12
  497. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/UserSession.d.ts.map +0 -1
  498. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/UserSession.js +0 -20
  499. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/UserSession.js.map +0 -1
  500. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/session.d.ts +0 -3
  501. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/session.d.ts.map +0 -1
  502. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/session.js +0 -10
  503. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/session.js.map +0 -1
  504. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/storage.d.ts +0 -25
  505. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/storage.d.ts.map +0 -1
  506. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/storage.js +0 -17
  507. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/storage.js.map +0 -1
  508. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/types.d.ts +0 -22
  509. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/types.d.ts.map +0 -1
  510. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/types.js +0 -16
  511. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/types.js.map +0 -1
  512. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/util.d.ts +0 -33
  513. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/util.d.ts.map +0 -1
  514. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/util.js +0 -128
  515. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/lib/util.js.map +0 -1
  516. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthContext.d.ts +0 -10
  517. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthContext.d.ts.map +0 -1
  518. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthContext.js +0 -3
  519. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthContext.js.map +0 -1
  520. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthProvider.d.ts +0 -20
  521. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthProvider.d.ts.map +0 -1
  522. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthProvider.js +0 -245
  523. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/AuthProvider.js.map +0 -1
  524. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/CivicAuthProvider.d.ts +0 -6
  525. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/CivicAuthProvider.d.ts.map +0 -1
  526. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/CivicAuthProvider.js +0 -15
  527. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/CivicAuthProvider.js.map +0 -1
  528. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/ConfigProvider.d.ts +0 -21
  529. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/ConfigProvider.d.ts.map +0 -1
  530. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/ConfigProvider.js +0 -19
  531. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/ConfigProvider.js.map +0 -1
  532. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/IframeProvider.d.ts +0 -16
  533. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/IframeProvider.d.ts.map +0 -1
  534. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/IframeProvider.js +0 -11
  535. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/IframeProvider.js.map +0 -1
  536. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/SessionProvider.d.ts +0 -13
  537. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/SessionProvider.d.ts.map +0 -1
  538. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/SessionProvider.js +0 -13
  539. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/SessionProvider.js.map +0 -1
  540. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/TokenProvider.d.ts +0 -18
  541. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/TokenProvider.d.ts.map +0 -1
  542. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/TokenProvider.js +0 -53
  543. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/TokenProvider.js.map +0 -1
  544. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/UserProvider.d.ts +0 -18
  545. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/UserProvider.d.ts.map +0 -1
  546. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/UserProvider.js +0 -38
  547. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/shared/providers/UserProvider.js.map +0 -1
  548. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/types.d.ts +0 -146
  549. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/types.d.ts.map +0 -1
  550. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/types.js +0 -2
  551. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/types.js.map +0 -1
  552. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/utils.d.ts +0 -17
  553. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/utils.d.ts.map +0 -1
  554. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/utils.js +0 -48
  555. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/src/utils.js.map +0 -1
  556. package/.rollup.cache/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/dist/esm/tsconfig.esm.tsbuildinfo +0 -1
  557. package/.turbo/turbo-lint.log +0 -6
  558. package/.turbo/turbo-test.log +0 -1364
  559. package/civic-auth-0.0.1-beta.21.tgz +0 -0
@@ -1,107 +0,0 @@
1
- import { NextResponse } from "next/server.js";
2
- import picomatch from "picomatch";
3
- import { resolveAuthConfig } from "@/nextjs/config.js";
4
- // Matches globs:
5
- // Examples:
6
- // /user
7
- // /user/*
8
- // /user/**/info
9
- const matchGlob = (pathname, globPattern) => {
10
- const matches = picomatch(globPattern);
11
- return matches(pathname);
12
- };
13
- // Matches globs:
14
- // Examples:
15
- // /user
16
- // /user/*
17
- // /user/**/info
18
- const matchesGlobs = (pathname, patterns) => patterns.some((pattern) => {
19
- if (!pattern)
20
- return false;
21
- console.log("matching", {
22
- pattern,
23
- pathname,
24
- match: matchGlob(pathname, pattern),
25
- });
26
- return matchGlob(pathname, pattern);
27
- });
28
- // internal - used by all exported functions
29
- const applyAuth = async (authConfig, request) => {
30
- const authConfigWithDefaults = resolveAuthConfig(authConfig);
31
- // Check for any valid auth token
32
- const isAuthenticated = !!request.cookies.get("id_token");
33
- // skip auth check for redirect to login url
34
- if (request.nextUrl.pathname === authConfigWithDefaults.loginUrl &&
35
- request.method === "GET") {
36
- console.log("→ Skipping auth check - this is the login URL");
37
- return undefined;
38
- }
39
- if (!matchesGlobs(request.nextUrl.pathname, authConfigWithDefaults.include)) {
40
- console.log("→ Skipping auth check - path not in include patterns");
41
- return undefined;
42
- }
43
- if (matchesGlobs(request.nextUrl.pathname, authConfigWithDefaults.exclude)) {
44
- console.log("→ Skipping auth check - path in exclude patterns");
45
- return undefined;
46
- }
47
- // Check for either token type
48
- if (!isAuthenticated) {
49
- const loginUrl = new URL(authConfigWithDefaults.loginUrl, request.url);
50
- console.log("→ No valid token found - redirecting to login", loginUrl);
51
- return NextResponse.redirect(loginUrl);
52
- }
53
- console.log("→ Auth check passed");
54
- return undefined;
55
- };
56
- /**
57
- *
58
- * Use this when auth is the only middleware you need.
59
- * Usage:
60
- *
61
- * export default authMiddleware({ loginUrl = '/login' }); // or just authMiddleware();
62
- *
63
- */
64
- export const authMiddleware = (authConfig = {}) => async (request) => {
65
- const response = await applyAuth(authConfig, request);
66
- if (response)
67
- return response;
68
- // NextJS doesn't do middleware chaining yet, so this does not mean
69
- // "call the next middleware" - it means "continue to the route handler"
70
- return NextResponse.next();
71
- };
72
- /**
73
- * Usage:
74
- *
75
- * export default withAuth(async (request) => {
76
- * console.log('my middleware');
77
- * return NextResponse.next();
78
- * })
79
- */
80
- // use this when you have your own middleware to chain
81
- export function withAuth(middleware) {
82
- return auth()(middleware);
83
- }
84
- /**
85
- * Use this when you want to configure the middleware here (an alternative is to do it in the next.config file)
86
- *
87
- * Usage:
88
- *
89
- * const withAuth = auth({ loginUrl = '/login' }); // or just auth();
90
- *
91
- * export default withAuth(async (request) => {
92
- * console.log('my middleware');
93
- * return NextResponse.next();
94
- * })
95
- *
96
- */
97
- export function auth(authConfig = {}) {
98
- return (middleware) => {
99
- return async (request) => {
100
- const response = await applyAuth(authConfig, request);
101
- if (response)
102
- return response;
103
- return middleware(request);
104
- };
105
- };
106
- }
107
- //# sourceMappingURL=middleware.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"middleware.js","sourceRoot":"","sources":["../../../../src/nextjs/middleware.ts"],"names":[],"mappings":"AAsBA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAMvD,iBAAiB;AACjB,YAAY;AACZ,QAAQ;AACR,UAAU;AACV,gBAAgB;AAChB,MAAM,SAAS,GAAG,CAAC,QAAgB,EAAE,WAAmB,EAAE,EAAE;IAC1D,MAAM,OAAO,GAAG,SAAS,CAAC,WAAW,CAAC,CAAC;IACvC,OAAO,OAAO,CAAC,QAAQ,CAAC,CAAC;AAC3B,CAAC,CAAC;AAEF,iBAAiB;AACjB,YAAY;AACZ,QAAQ;AACR,UAAU;AACV,gBAAgB;AAChB,MAAM,YAAY,GAAG,CAAC,QAAgB,EAAE,QAAkB,EAAE,EAAE,CAC5D,QAAQ,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,EAAE;IACxB,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE;QACtB,OAAO;QACP,QAAQ;QACR,KAAK,EAAE,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC;KACpC,CAAC,CAAC;IACH,OAAO,SAAS,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;AACtC,CAAC,CAAC,CAAC;AAEL,4CAA4C;AAC5C,MAAM,SAAS,GAAG,KAAK,EACrB,UAAsB,EACtB,OAAoB,EACe,EAAE;IACrC,MAAM,sBAAsB,GAAG,iBA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AE;IACpD,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACtD,IAAI,QAAQ;QAAE,OAAO,QAAQ,CAAC;IAE9B,mEAAmE;IACnE,wEAAwE;IACxE,OAAO,YAAY,CAAC,IAAI,EAAE,CAAC;AAC7B,CAAC,CAAC;AAEJ;;;;;;;GAOG;AACH,sDAAsD;AACtD,MAAM,UAAU,QAAQ,CACtB,UAAsB;IAEtB,OAAO,IAAI,EAAE,CAAC,UAAU,CAAC,CAAC;AAC5B,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,IAAI,CAAC,aAAyB,EAAE;IAC9C,OAAO,CACL,UAAsB,EAC6B,EAAE;QACrD,OAAO,KAAK,EAAE,OAAoB,EAAyB,EAAE;YAC3D,MAAM,QAAQ,GAAG,MAAM,SAAS,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;YACtD,IAAI,QAAQ;gBAAE,OAAO,QAAQ,CAAC;YAE9B,OAAO,UAAU,CAAC,OAAO,CAAC,CAAC;QAC7B,CAAC,CAAC;IACJ,CAAC,CAAC;AACJ,CAAC","sourcesContent":["/**\n * Authenticates the user on all requests by checking the token cookie\n *\n * Usage:\n * Option 1: use if no other middleware (e.g. no next-intl etc)\n * export default authMiddleware();\n *\n * Option 2: use if other middleware is needed - default auth config\n * export default withAuth((request) => {\n * console.log('in custom middleware', request.nextUrl.pathname);\n * return NextResponse.next();\n * })\n *\n * Option 3: use if other middleware is needed - specifying auth config\n * const withCivicAuth = auth({ loginUrl: '/login', include: ['/[.*]/user'] })\n * export default withCivicAuth((request) => {\n * console.log('in custom middleware', request.url);\n * return NextResponse.next();\n * })\n *\n */\nimport type { NextRequest } from \"next/server.js\";\nimport { NextResponse } from \"next/server.js\";\nimport picomatch from \"picomatch\";\nimport type { AuthConfig } from \"@/nextjs/config.js\";\nimport { resolveAuthConfig } from \"@/nextjs/config.js\";\n\ntype Middleware = (\n request: NextRequest,\n) => Promise<NextResponse> | NextResponse;\n\n// Matches globs:\n// Examples:\n// /user\n// /user/*\n// /user/**/info\nconst matchGlob = (pathname: string, globPattern: string) => {\n const matches = picomatch(globPattern);\n return matches(pathname);\n};\n\n// Matches globs:\n// Examples:\n// /user\n// /user/*\n// /user/**/info\nconst matchesGlobs = (pathname: string, patterns: string[]) =>\n patterns.some((pattern) => {\n if (!pattern) return false;\n console.log(\"matching\", {\n pattern,\n pathname,\n match: matchGlob(pathname, pattern),\n });\n return matchGlob(pathname, pattern);\n });\n\n// internal - used by all exported functions\nconst applyAuth = async (\n authConfig: AuthConfig,\n request: NextRequest,\n): Promise<NextResponse | undefined> => {\n const authConfigWithDefaults = resolveAuthConfig(authConfig);\n // Check for any valid auth token\n const isAuthenticated = !!request.cookies.get(\"id_token\");\n\n // skip auth check for redirect to login url\n if (\n request.nextUrl.pathname === authConfigWithDefaults.loginUrl &&\n request.method === \"GET\"\n ) {\n console.log(\"→ Skipping auth check - this is the login URL\");\n return undefined;\n }\n\n if (!matchesGlobs(request.nextUrl.pathname, authConfigWithDefaults.include)) {\n console.log(\"→ Skipping auth check - path not in include patterns\");\n return undefined;\n }\n\n if (matchesGlobs(request.nextUrl.pathname, authConfigWithDefaults.exclude)) {\n console.log(\"→ Skipping auth check - path in exclude patterns\");\n return undefined;\n }\n\n // Check for either token type\n if (!isAuthenticated) {\n const loginUrl = new URL(authConfigWithDefaults.loginUrl, request.url);\n console.log(\"→ No valid token found - redirecting to login\", loginUrl);\n return NextResponse.redirect(loginUrl);\n }\n\n console.log(\"→ Auth check passed\");\n return undefined;\n};\n\n/**\n *\n * Use this when auth is the only middleware you need.\n * Usage:\n *\n * export default authMiddleware({ loginUrl = '/login' }); // or just authMiddleware();\n *\n */\nexport const authMiddleware =\n (authConfig: Partial<AuthConfig> = {}) =>\n async (request: NextRequest): Promise<NextResponse> => {\n const response = await applyAuth(authConfig, request);\n if (response) return response;\n\n // NextJS doesn't do middleware chaining yet, so this does not mean\n // \"call the next middleware\" - it means \"continue to the route handler\"\n return NextResponse.next();\n };\n\n/**\n * Usage:\n *\n * export default withAuth(async (request) => {\n * console.log('my middleware');\n * return NextResponse.next();\n * })\n */\n// use this when you have your own middleware to chain\nexport function withAuth(\n middleware: Middleware,\n): (request: NextRequest) => Promise<NextResponse> {\n return auth()(middleware);\n}\n\n/**\n * Use this when you want to configure the middleware here (an alternative is to do it in the next.config file)\n *\n * Usage:\n *\n * const withAuth = auth({ loginUrl = '/login' }); // or just auth();\n *\n * export default withAuth(async (request) => {\n * console.log('my middleware');\n * return NextResponse.next();\n * })\n *\n */\nexport function auth(authConfig: AuthConfig = {}) {\n return (\n middleware: Middleware,\n ): ((request: NextRequest) => Promise<NextResponse>) => {\n return async (request: NextRequest): Promise<NextResponse> => {\n const response = await applyAuth(authConfig, request);\n if (response) return response;\n\n return middleware(request);\n };\n };\n}\n"]}
@@ -1,9 +0,0 @@
1
- /**
2
- * A very small context provider for the user object - it takes the user object from the cookie and provides it to the app.
3
- */
4
- import React from "react";
5
- import type { AuthProviderProps } from "@/shared/providers/AuthProvider.js";
6
- type NextCivicAuthProviderProps = Omit<AuthProviderProps, "clientId">;
7
- declare const CivicNextAuthProvider: ({ children, ...props }: NextCivicAuthProviderProps) => React.JSX.Element;
8
- export { CivicNextAuthProvider, type NextCivicAuthProviderProps };
9
- //# sourceMappingURL=NextAuthProvider.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextAuthProvider.d.ts","sourceRoot":"","sources":["../../../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":"AACA;;GAEG;AACH,OAAO,KAA8B,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oCAAoC,CAAC;AAe5E,KAAK,0BAA0B,GAAG,IAAI,CAAC,iBAAiB,EAAE,UAAU,CAAC,CAAC;AAqDtE,QAAA,MAAM,qBAAqB,2BAGxB,0BAA0B,sBAQ5B,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAE,KAAK,0BAA0B,EAAE,CAAC"}
@@ -1,50 +0,0 @@
1
- "use client";
2
- /**
3
- * A very small context provider for the user object - it takes the user object from the cookie and provides it to the app.
4
- */
5
- import React, { useEffect, useState } from "react";
6
- import { AuthProvider } from "@/shared/providers/AuthProvider.js";
7
- import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
8
- import { resolveAuthConfig } from "@/nextjs/config.js";
9
- import { resolveCallbackUrl } from "@/nextjs/utils.js";
10
- import { ConfidentialClientPKCEConsumer } from "@/services/PKCE.js";
11
- import { NextjsClientStorage } from "@/nextjs/cookies.js";
12
- import { UserProvider } from "@/shared/providers/UserProvider.js";
13
- import { OAuthTokens } from "@/shared/lib/types.js";
14
- import { useUserCookie } from "@/nextjs/hooks/useUserCookie.js";
15
- import { useTokenCookie } from "@/nextjs/hooks/index.js";
16
- const queryClient = new QueryClient();
17
- const CivicNextAuthProviderInternal = ({ children, ...props }) => {
18
- const [redirectUrl, setRedirectUrl] = useState("");
19
- const resolvedConfig = resolveAuthConfig();
20
- const { clientId, oauthServer, callbackUrl, challengeUrl, logoutUrl } = resolvedConfig;
21
- useEffect(() => {
22
- if (typeof globalThis.window !== "undefined") {
23
- const appUrl = globalThis.window.location.origin;
24
- setRedirectUrl(resolveCallbackUrl(resolvedConfig, appUrl));
25
- }
26
- }, [callbackUrl, resolvedConfig]);
27
- const user = useUserCookie();
28
- const idToken = useTokenCookie(OAuthTokens.ID_TOKEN);
29
- const combinedUser = user ? { ...(user || {}), idToken } : null;
30
- const sessionData = {
31
- authenticated: !!user,
32
- ...(idToken ? { idToken } : {}),
33
- };
34
- const signOut = async () => {
35
- if (props.onSignOut) {
36
- await props.onSignOut();
37
- }
38
- const appUrl = globalThis.window.location.origin;
39
- window.location.href = `${logoutUrl}?appUrl=${appUrl}`;
40
- return;
41
- };
42
- return (React.createElement(AuthProvider, { ...props, redirectUrl: redirectUrl, config: { oauthServer }, clientId: clientId, pkceConsumer: new ConfidentialClientPKCEConsumer(challengeUrl), sessionData: sessionData },
43
- React.createElement(UserProvider, { storage: new NextjsClientStorage(), user: combinedUser, signOut: signOut }, children)));
44
- };
45
- const CivicNextAuthProvider = ({ children, ...props }) => {
46
- return (React.createElement(QueryClientProvider, { client: queryClient },
47
- React.createElement(CivicNextAuthProviderInternal, { ...props }, children)));
48
- };
49
- export { CivicNextAuthProvider };
50
- //# sourceMappingURL=NextAuthProvider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"NextAuthProvider.js","sourceRoot":"","sources":["../../../../../src/nextjs/providers/NextAuthProvider.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb;;GAEG;AACH,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEnD,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAEzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,8BAA8B,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAClE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAEzD,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAC;AAItC,MAAM,6BAA6B,GAAG,CAAC,EACrC,QAAQ,EACR,GAAG,KAAK,EACmB,EAAE,EAAE;IAC/B,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAS,EAAE,CAAC,CAAC;IAC3D,MAAM,cAA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B,MAAM,EAAE,EAAE,WAAW,EAAE,EACvB,QAAQ,EAAE,QAAQ,EAClB,YAAY,EAAE,IAAI,8BAA8B,CAAC,YAAY,CAAC,EAC9D,WAAW,EAAE,WAAW;QAExB,oBAAC,YAAY,IACX,OAAO,EAAE,IAAI,mBAAmB,EAAE,EAClC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,OAAO,IAEf,QAAQ,CACI,CACF,CAChB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,qBAAqB,GAAG,CAAC,EAC7B,QAAQ,EACR,GAAG,KAAK,EACmB,EAAE,EAAE;IAC/B,OAAO,CACL,oBAAC,mBAAmB,IAAC,MAAM,EAAE,WAAW;QACtC,oBAAC,6BAA6B,OAAK,KAAK,IACrC,QAAQ,CACqB,CACZ,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,qBAAqB,EAAmC,CAAC","sourcesContent":["\"use client\";\n/**\n * A very small context provider for the user object - it takes the user object from the cookie and provides it to the app.\n */\nimport React, { useEffect, useState } from \"react\";\nimport type { AuthProviderProps } from \"@/shared/providers/AuthProvider.js\";\nimport { AuthProvider } from \"@/shared/providers/AuthProvider.js\";\nimport { QueryClient, QueryClientProvider } from \"@tanstack/react-query\";\nimport type { User } from \"@/types.js\";\nimport { resolveAuthConfig } from \"@/nextjs/config.js\";\nimport { resolveCallbackUrl } from \"@/nextjs/utils.js\";\nimport { ConfidentialClientPKCEConsumer } from \"@/services/PKCE.js\";\nimport { NextjsClientStorage } from \"@/nextjs/cookies.js\";\nimport { UserProvider } from \"@/shared/providers/UserProvider.js\";\nimport { OAuthTokens } from \"@/shared/lib/types.js\";\nimport { useUserCookie } from \"@/nextjs/hooks/useUserCookie.js\";\nimport { useTokenCookie } from \"@/nextjs/hooks/index.js\";\n\nconst queryClient = new QueryClient();\n\ntype NextCivicAuthProviderProps = Omit<AuthProviderProps, \"clientId\">;\n\nconst CivicNextAuthProviderInternal = ({\n children,\n ...props\n}: NextCivicAuthProviderProps) => {\n const [redirectUrl, setRedirectUrl] = useState<string>(\"\");\n const resolvedConfig = resolveAuthConfig();\n const { clientId, oauthServer, callbackUrl, challengeUrl, logoutUrl } =\n resolvedConfig;\n\n useEffect(() => {\n if (typeof globalThis.window !== \"undefined\") {\n const appUrl = globalThis.window.location.origin;\n setRedirectUrl(resolveCallbackUrl(resolvedConfig, appUrl));\n }\n }, [callbackUrl, resolvedConfig]);\n\n const user = useUserCookie();\n const idToken = useTokenCookie(OAuthTokens.ID_TOKEN);\n const combinedUser = user ? ({ ...(user || {}), idToken } as User) : null;\n const sessionData = {\n authenticated: !!user,\n ...(idToken ? { idToken } : {}),\n };\n const signOut = async (): Promise<void> => {\n if (props.onSignOut) {\n await props.onSignOut();\n }\n const appUrl = globalThis.window.location.origin;\n window.location.href = `${logoutUrl}?appUrl=${appUrl}`;\n return;\n };\n return (\n <AuthProvider\n {...props}\n redirectUrl={redirectUrl}\n config={{ oauthServer }}\n clientId={clientId}\n pkceConsumer={new ConfidentialClientPKCEConsumer(challengeUrl)}\n sessionData={sessionData}\n >\n <UserProvider\n storage={new NextjsClientStorage()}\n user={combinedUser}\n signOut={signOut}\n >\n {children}\n </UserProvider>\n </AuthProvider>\n );\n};\n\nconst CivicNextAuthProvider = ({\n children,\n ...props\n}: NextCivicAuthProviderProps) => {\n return (\n <QueryClientProvider client={queryClient}>\n <CivicNextAuthProviderInternal {...props}>\n {children}\n </CivicNextAuthProviderInternal>\n </QueryClientProvider>\n );\n};\n\nexport { CivicNextAuthProvider, type NextCivicAuthProviderProps };\n"]}
@@ -1,18 +0,0 @@
1
- import type { NextRequest } from "next/server.js";
2
- import { NextResponse } from "next/server.js";
3
- import type { AuthConfig } from "@/nextjs/config.js";
4
- export declare function handleLogout(request: NextRequest, config: AuthConfig): Promise<NextResponse>;
5
- /**
6
- * Creates an authentication handler for Next.js API routes
7
- *
8
- * Usage:
9
- * ```ts
10
- * // app/api/auth/[...civicauth]/route.ts
11
- * import { handler } from '@civic/auth/nextjs'
12
- * export const GET = handler({
13
- * // optional config overrides
14
- * })
15
- * ```
16
- */
17
- export declare const handler: (authConfig?: {}) => (request: NextRequest) => Promise<NextResponse>;
18
- //# sourceMappingURL=routeHandler.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routeHandler.d.ts","sourceRoot":"","sources":["../../../../src/nextjs/routeHandler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AA4NrD,wBAAsB,YAAY,CAChC,OAAO,EAAE,WAAW,EACpB,MAAM,EAAE,UAAU,GACjB,OAAO,CAAC,YAAY,CAAC,CA4BvB;AAED;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,OAAO,iCAEF,WAAW,KAAG,OAAO,CAAC,YAAY,CA8BjD,CAAC"}
@@ -1,216 +0,0 @@
1
- import { NextResponse } from "next/server.js";
2
- import { revalidatePath } from "next/cache.js";
3
- import { resolveAuthConfig } from "@/nextjs/config.js";
4
- import { loggers } from "@/lib/logger.js";
5
- import { clearAuthCookies, NextjsClientStorage, NextjsCookieStorage, } from "@/nextjs/cookies.js";
6
- import { GenericPublicClientPKCEProducer } from "@/services/PKCE.js";
7
- import { resolveOAuthAccessCode } from "@/server/login.js";
8
- import { getUser } from "@/shared/lib/session.js";
9
- import { resolveCallbackUrl } from "@/nextjs/utils.js";
10
- import { GenericUserSession } from "@/shared/lib/UserSession.js";
11
- import { TOKEN_EXCHANGE_SUCCESS_TEXT, TOKEN_EXCHANGE_TRIGGER_TEXT, } from "@/constants.js";
12
- import { serverTokenExchangeFromState } from "@/lib/oauth.js";
13
- import { cookies } from "next/headers.js";
14
- import { CodeVerifier } from "@/shared/lib/types.js";
15
- const logger = loggers.nextjs.handlers.auth;
16
- class AuthError extends Error {
17
- status;
18
- constructor(message, status = 401) {
19
- super(message);
20
- this.status = status;
21
- this.name = "AuthError";
22
- }
23
- }
24
- /**
25
- * create a code verifier and challenge for PKCE
26
- * saving the verifier in a cookie for later use
27
- * @returns {Promise<NextResponse>}
28
- */
29
- async function handleChallenge(request, config) {
30
- const cookieStorage = new NextjsCookieStorage(config.cookies?.tokens ?? {});
31
- const pkceProducer = new GenericPublicClientPKCEProducer(cookieStorage);
32
- const challenge = await pkceProducer.getCodeChallenge();
33
- const appUrl = request.nextUrl.searchParams.get("appUrl");
34
- if (appUrl) {
35
- cookieStorage.set(CodeVerifier.APP_URL, appUrl);
36
- }
37
- return NextResponse.json({ status: "success", challenge });
38
- }
39
- async function performTokenExchangeAndSetCookies(request, config, code, state, appUrl) {
40
- const resolvedConfigs = resolveAuthConfig(config);
41
- const cookieStorage = new NextjsCookieStorage(resolvedConfigs.cookies.tokens);
42
- const callbackUrl = resolveCallbackUrl(resolvedConfigs, appUrl);
43
- try {
44
- await resolveOAuthAccessCode(code, state, cookieStorage, {
45
- ...resolvedConfigs,
46
- redirectUrl: callbackUrl,
47
- });
48
- }
49
- catch (error) {
50
- logger.error("Token exchange failed:", error);
51
- throw new AuthError("Failed to authenticate user", 401);
52
- }
53
- const user = await getUser(cookieStorage);
54
- if (!user) {
55
- throw new AuthError("Failed to get user info", 401);
56
- }
57
- const clientStorage = new NextjsClientStorage();
58
- const userSession = new GenericUserSession(clientStorage);
59
- userSession.set(user);
60
- }
61
- async function handleCallback(request, config) {
62
- const resolvedConfigs = resolveAuthConfig(config);
63
- console.log("handleCallback", { request, resolvedConfigs });
64
- const code = request.nextUrl.searchParams.get("code");
65
- const state = request.nextUrl.searchParams.get("state") || "";
66
- if (!code || !state)
67
- throw new AuthError("Bad parameters", 400);
68
- // appUrl is passed from the client to the server in the query string
69
- // this is necessary because the server does not have access to the client's window.location.origin
70
- // and can not accurately determine the appUrl (specially if the app is behind a reverse proxy)
71
- const appUrl = request.cookies.get(CodeVerifier.APP_URL)?.value ||
72
- request.nextUrl.searchParams.get("appUrl");
73
- // If we have a code_verifier cookie and the appUrl, we can do a token exchange.
74
- // Otherwise, just render an empty page.
75
- // The initial redirect back from the auth server does not send cookies, because the redirect is from a 3rd-party domain.
76
- // The client will make an additional call to this route with cookies included, at which point we do the token exchange.
77
- console.log("handleCallback", {
78
- code,
79
- state,
80
- cookies: cookies(),
81
- appUrl,
82
- });
83
- const codeVerifier = request.cookies.get(CodeVerifier.COOKIE_NAME);
84
- if (!codeVerifier || !appUrl) {
85
- console.log("handleCallback no code_verifier found", {
86
- state,
87
- serverTokenExchange: serverTokenExchangeFromState(`${state}`),
88
- });
89
- let response = new NextResponse(`<html><body><span style="display:none">${TOKEN_EXCHANGE_TRIGGER_TEXT}</span></body></html>`);
90
- // in server-side token exchange mode we need to launch a page that will trigger the token exchange
91
- // from the same domain, allowing it access to the code_verifier cookie
92
- // we only need to do this in redirect mode, as the iframe already triggers a client-side token exchange
93
- // if no code-verifier cookie is found
94
- if (state && serverTokenExchangeFromState(state)) {
95
- console.log("handleCallback serverTokenExchangeFromState, launching redirect page...", {
96
- requestUrl: request.url,
97
- configCallbackUrl: resolvedConfigs.callbackUrl,
98
- });
99
- // we need to replace the URL with resolved config in case the server is hosted
100
- // behind a reverse proxy or load balancer
101
- const requestUrl = new URL(request.url);
102
- const fetchUrl = `${resolvedConfigs.callbackUrl}?${requestUrl.searchParams.toString()}&sameDomainServerTokenExchange=true`;
103
- response = new NextResponse(`<html>
104
- <body>
105
- <span style="display:none">
106
- <script>
107
- window.onload = function () {
108
- const appUrl = globalThis.window?.location?.origin;
109
- fetch('${fetchUrl}&appUrl=' + appUrl).then((response) => {
110
- response.json().then((jsonResponse) => {
111
- console.log('fetch jsonResponse', jsonResponse);
112
- if (jsonResponse.redirectUrl) {
113
- console.log('handleCallback serverTokenExchangeFromState, redirecting');
114
- window.location.href = jsonResponse.redirectUrl;
115
- }
116
- });
117
- });
118
- };
119
- </script>
120
- </span>
121
- </body>
122
- </html>
123
- `);
124
- }
125
- response.headers.set("Content-Type", "text/html; charset=utf-8");
126
- console.log(`handleCallback no code_verifier found, returning ${TOKEN_EXCHANGE_TRIGGER_TEXT}`);
127
- return response;
128
- }
129
- await performTokenExchangeAndSetCookies(request, resolvedConfigs, code, state, appUrl);
130
- if (request.url.includes("sameDomainServerTokenExchange=true")) {
131
- console.log("handleCallback sameDomainServerTokenExchange = true, returnining redirectUrl", appUrl);
132
- return NextResponse.json({
133
- status: "success",
134
- redirectUrl: appUrl,
135
- });
136
- }
137
- // this is the case where a 'normal' redirect is happening
138
- if (serverTokenExchangeFromState(state)) {
139
- console.log("handleCallback serverTokenExchangeFromState, redirect to appUrl", appUrl);
140
- if (!appUrl) {
141
- throw new Error("appUrl undefined. Cannot redirect.");
142
- }
143
- return NextResponse.redirect(`${appUrl}`);
144
- }
145
- // return an empty HTML response so the iframe doesn't show any response
146
- // in the short moment between the redirect and the parent window
147
- // acknowledging the redirect and closing the iframe
148
- const response = new NextResponse(`<html><span style="display:none">${TOKEN_EXCHANGE_SUCCESS_TEXT}</span></html>`);
149
- response.headers.set("Content-Type", "text/html; charset=utf-8");
150
- return response;
151
- }
152
- /**
153
- * If redirectPath is an absolute path, return it as-is.
154
- * Otherwise for relative paths, append it to the current domain.
155
- * @param redirectPath
156
- * @returns
157
- */
158
- const getAbsoluteRedirectPath = (redirectPath, currentBasePath) => new URL(redirectPath, currentBasePath).href;
159
- export async function handleLogout(request, config) {
160
- const resolvedConfigs = resolveAuthConfig(config);
161
- const defaultRedirectPath = resolvedConfigs.loginUrl ?? "/";
162
- const redirectTarget = new URL(request.url).searchParams.get("redirect") || defaultRedirectPath;
163
- const isAbsoluteRedirect = /^(https?:\/\/|www\.).+/i.test(redirectTarget);
164
- const appUrl = request.nextUrl.searchParams.get("appUrl");
165
- const finalRedirectUrl = isAbsoluteRedirect
166
- ? redirectTarget
167
- : getAbsoluteRedirectPath(redirectTarget, new URL(appUrl ?? request.url).origin);
168
- const response = NextResponse.redirect(finalRedirectUrl);
169
- clearAuthCookies(config);
170
- try {
171
- revalidatePath(isAbsoluteRedirect ? finalRedirectUrl : redirectTarget);
172
- }
173
- catch (error) {
174
- logger.warn("Failed to revalidate path after logout:", error);
175
- }
176
- return response;
177
- }
178
- /**
179
- * Creates an authentication handler for Next.js API routes
180
- *
181
- * Usage:
182
- * ```ts
183
- * // app/api/auth/[...civicauth]/route.ts
184
- * import { handler } from '@civic/auth/nextjs'
185
- * export const GET = handler({
186
- * // optional config overrides
187
- * })
188
- * ```
189
- */
190
- export const handler = (authConfig = {}) => async (request) => {
191
- const config = resolveAuthConfig(authConfig);
192
- try {
193
- const pathname = request.nextUrl.pathname;
194
- const pathSegments = pathname.split("/");
195
- const lastSegment = pathSegments[pathSegments.length - 1];
196
- switch (lastSegment) {
197
- case "challenge":
198
- return await handleChallenge(request, config);
199
- case "callback":
200
- return await handleCallback(request, config);
201
- case "logout":
202
- return await handleLogout(request, config);
203
- default:
204
- throw new AuthError(`Invalid auth route: ${pathname}`, 404);
205
- }
206
- }
207
- catch (error) {
208
- logger.error("Auth handler error:", error);
209
- const status = error instanceof AuthError ? error.status : 500;
210
- const message = error instanceof Error ? error.message : "Authentication failed";
211
- const response = NextResponse.json({ error: message }, { status });
212
- clearAuthCookies(config);
213
- return response;
214
- }
215
- };
216
- //# sourceMappingURL=routeHandler.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"routeHandler.js","sourceRoot":"","sources":["../../../../src/nextjs/routeHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC1C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,+BAA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CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,uBAAuB,CAAC;QAEnE,MAAM,QAAQ,GAAG,YAAY,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC;QAEnE,gBAAgB,CAAC,MAAM,CAAC,CAAC;QACzB,OAAO,QAAQ,CAAC;IAClB,CAAC;AACH,CAAC,CAAC","sourcesContent":["import type { NextRequest } from \"next/server.js\";\nimport { NextResponse } from \"next/server.js\";\nimport { revalidatePath } from \"next/cache.js\";\nimport type { AuthConfig } from \"@/nextjs/config.js\";\nimport { resolveAuthConfig } from \"@/nextjs/config.js\";\nimport { loggers } from \"@/lib/logger.js\";\nimport {\n clearAuthCookies,\n NextjsClientStorage,\n NextjsCookieStorage,\n} from \"@/nextjs/cookies.js\";\nimport { GenericPublicClientPKCEProducer } from \"@/services/PKCE.js\";\nimport { resolveOAuthAccessCode } from \"@/server/login.js\";\nimport { getUser } from \"@/shared/lib/session.js\";\nimport { resolveCallbackUrl } from \"@/nextjs/utils.js\";\nimport { GenericUserSession } from \"@/shared/lib/UserSession.js\";\nimport {\n TOKEN_EXCHANGE_SUCCESS_TEXT,\n TOKEN_EXCHANGE_TRIGGER_TEXT,\n} from \"@/constants.js\";\nimport { serverTokenExchangeFromState } from \"@/lib/oauth.js\";\nimport { cookies } from \"next/headers.js\";\nimport { CodeVerifier } from \"@/shared/lib/types.js\";\n\nconst logger = loggers.nextjs.handlers.auth;\n\nclass AuthError extends Error {\n constructor(\n message: string,\n public readonly status: number = 401,\n ) {\n super(message);\n this.name = \"AuthError\";\n }\n}\n\n/**\n * create a code verifier and challenge for PKCE\n * saving the verifier in a cookie for later use\n * @returns {Promise<NextResponse>}\n */\nasync function handleChallenge(\n request: NextRequest,\n config: AuthConfig,\n): Promise<NextResponse> {\n const cookieStorage = new NextjsCookieStorage(config.cookies?.tokens ?? {});\n const pkceProducer = new GenericPublicClientPKCEProducer(cookieStorage);\n\n const challenge = await pkceProducer.getCodeChallenge();\n const appUrl = request.nextUrl.searchParams.get(\"appUrl\");\n if (appUrl) {\n cookieStorage.set(CodeVerifier.APP_URL, appUrl);\n }\n return NextResponse.json({ status: \"success\", challenge });\n}\n\nasync function performTokenExchangeAndSetCookies(\n request: NextRequest,\n config: AuthConfig,\n code: string,\n state: string,\n appUrl: string,\n) {\n const resolvedConfigs = resolveAuthConfig(config);\n const cookieStorage = new NextjsCookieStorage(resolvedConfigs.cookies.tokens);\n\n const callbackUrl = resolveCallbackUrl(resolvedConfigs, appUrl);\n try {\n await resolveOAuthAccessCode(code, state, cookieStorage, {\n ...resolvedConfigs,\n redirectUrl: callbackUrl,\n });\n } catch (error) {\n logger.error(\"Token exchange failed:\", error);\n throw new AuthError(\"Failed to authenticate user\", 401);\n }\n\n const user = await getUser(cookieStorage);\n if (!user) {\n throw new AuthError(\"Failed to get user info\", 401);\n }\n\n const clientStorage = new NextjsClientStorage();\n const userSession = new GenericUserSession(clientStorage);\n userSession.set(user);\n}\nasync function handleCallback(\n request: NextRequest,\n config: AuthConfig,\n): Promise<NextResponse> {\n const resolvedConfigs = resolveAuthConfig(config);\n console.log(\"handleCallback\", { request, resolvedConfigs });\n const code = request.nextUrl.searchParams.get(\"code\");\n const state = request.nextUrl.searchParams.get(\"state\") || \"\";\n if (!code || !state) throw new AuthError(\"Bad parameters\", 400);\n\n // appUrl is passed from the client to the server in the query string\n // this is necessary because the server does not have access to the client's window.location.origin\n // and can not accurately determine the appUrl (specially if the app is behind a reverse proxy)\n const appUrl =\n request.cookies.get(CodeVerifier.APP_URL)?.value ||\n request.nextUrl.searchParams.get(\"appUrl\");\n\n // If we have a code_verifier cookie and the appUrl, we can do a token exchange.\n // Otherwise, just render an empty page.\n // The initial redirect back from the auth server does not send cookies, because the redirect is from a 3rd-party domain.\n // The client will make an additional call to this route with cookies included, at which point we do the token exchange.\n console.log(\"handleCallback\", {\n code,\n state,\n cookies: cookies(),\n appUrl,\n });\n\n const codeVerifier = request.cookies.get(CodeVerifier.COOKIE_NAME);\n\n if (!codeVerifier || !appUrl) {\n console.log(\"handleCallback no code_verifier found\", {\n state,\n serverTokenExchange: serverTokenExchangeFromState(`${state}`),\n });\n let response = new NextResponse(\n `<html><body><span style=\"display:none\">${TOKEN_EXCHANGE_TRIGGER_TEXT}</span></body></html>`,\n );\n\n // in server-side token exchange mode we need to launch a page that will trigger the token exchange\n // from the same domain, allowing it access to the code_verifier cookie\n // we only need to do this in redirect mode, as the iframe already triggers a client-side token exchange\n // if no code-verifier cookie is found\n if (state && serverTokenExchangeFromState(state)) {\n console.log(\n \"handleCallback serverTokenExchangeFromState, launching redirect page...\",\n {\n requestUrl: request.url,\n configCallbackUrl: resolvedConfigs.callbackUrl,\n },\n );\n // we need to replace the URL with resolved config in case the server is hosted\n // behind a reverse proxy or load balancer\n const requestUrl = new URL(request.url);\n const fetchUrl = `${resolvedConfigs.callbackUrl}?${requestUrl.searchParams.toString()}&sameDomainServerTokenExchange=true`;\n response = new NextResponse(\n `<html>\n <body>\n <span style=\"display:none\">\n <script>\n window.onload = function () {\n const appUrl = globalThis.window?.location?.origin;\n fetch('${fetchUrl}&appUrl=' + appUrl).then((response) => {\n response.json().then((jsonResponse) => {\n console.log('fetch jsonResponse', jsonResponse);\n if (jsonResponse.redirectUrl) {\n console.log('handleCallback serverTokenExchangeFromState, redirecting');\n window.location.href = jsonResponse.redirectUrl;\n }\n });\n });\n };\n </script>\n </span>\n </body>\n </html>\n `,\n );\n }\n response.headers.set(\"Content-Type\", \"text/html; charset=utf-8\");\n console.log(\n `handleCallback no code_verifier found, returning ${TOKEN_EXCHANGE_TRIGGER_TEXT}`,\n );\n return response;\n }\n\n await performTokenExchangeAndSetCookies(\n request,\n resolvedConfigs,\n code,\n state,\n appUrl,\n );\n\n if (request.url.includes(\"sameDomainServerTokenExchange=true\")) {\n console.log(\n \"handleCallback sameDomainServerTokenExchange = true, returnining redirectUrl\",\n appUrl,\n );\n return NextResponse.json({\n status: \"success\",\n redirectUrl: appUrl,\n });\n }\n\n // this is the case where a 'normal' redirect is happening\n if (serverTokenExchangeFromState(state)) {\n console.log(\n \"handleCallback serverTokenExchangeFromState, redirect to appUrl\",\n appUrl,\n );\n if (!appUrl) {\n throw new Error(\"appUrl undefined. Cannot redirect.\");\n }\n return NextResponse.redirect(`${appUrl}`);\n }\n // return an empty HTML response so the iframe doesn't show any response\n // in the short moment between the redirect and the parent window\n // acknowledging the redirect and closing the iframe\n const response = new NextResponse(\n `<html><span style=\"display:none\">${TOKEN_EXCHANGE_SUCCESS_TEXT}</span></html>`,\n );\n response.headers.set(\"Content-Type\", \"text/html; charset=utf-8\");\n return response;\n}\n\n/**\n * If redirectPath is an absolute path, return it as-is.\n * Otherwise for relative paths, append it to the current domain.\n * @param redirectPath\n * @returns\n */\nconst getAbsoluteRedirectPath = (\n redirectPath: string,\n currentBasePath: string,\n) => new URL(redirectPath, currentBasePath).href;\n\nexport async function handleLogout(\n request: NextRequest,\n config: AuthConfig,\n): Promise<NextResponse> {\n const resolvedConfigs = resolveAuthConfig(config);\n const defaultRedirectPath = resolvedConfigs.loginUrl ?? \"/\";\n const redirectTarget =\n new URL(request.url).searchParams.get(\"redirect\") || defaultRedirectPath;\n\n const isAbsoluteRedirect = /^(https?:\\/\\/|www\\.).+/i.test(redirectTarget);\n\n const appUrl = request.nextUrl.searchParams.get(\"appUrl\");\n\n const finalRedirectUrl = isAbsoluteRedirect\n ? redirectTarget\n : getAbsoluteRedirectPath(\n redirectTarget,\n new URL(appUrl ?? request.url).origin,\n );\n\n const response = NextResponse.redirect(finalRedirectUrl);\n\n clearAuthCookies(config);\n\n try {\n revalidatePath(isAbsoluteRedirect ? finalRedirectUrl : redirectTarget);\n } catch (error) {\n logger.warn(\"Failed to revalidate path after logout:\", error);\n }\n\n return response;\n}\n\n/**\n * Creates an authentication handler for Next.js API routes\n *\n * Usage:\n * ```ts\n * // app/api/auth/[...civicauth]/route.ts\n * import { handler } from '@civic/auth/nextjs'\n * export const GET = handler({\n * // optional config overrides\n * })\n * ```\n */\nexport const handler =\n (authConfig = {}) =>\n async (request: NextRequest): Promise<NextResponse> => {\n const config = resolveAuthConfig(authConfig);\n\n try {\n const pathname = request.nextUrl.pathname;\n const pathSegments = pathname.split(\"/\");\n const lastSegment = pathSegments[pathSegments.length - 1];\n\n switch (lastSegment) {\n case \"challenge\":\n return await handleChallenge(request, config);\n case \"callback\":\n return await handleCallback(request, config);\n case \"logout\":\n return await handleLogout(request, config);\n default:\n throw new AuthError(`Invalid auth route: ${pathname}`, 404);\n }\n } catch (error) {\n logger.error(\"Auth handler error:\", error);\n\n const status = error instanceof AuthError ? error.status : 500;\n const message =\n error instanceof Error ? error.message : \"Authentication failed\";\n\n const response = NextResponse.json({ error: message }, { status });\n\n clearAuthCookies(config);\n return response;\n }\n };\n"]}
@@ -1,3 +0,0 @@
1
- import type { AuthConfigWithDefaults } from "@/nextjs/config.js";
2
- export declare const resolveCallbackUrl: (config: AuthConfigWithDefaults, baseUrl?: string) => string;
3
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/nextjs/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,eAAO,MAAM,kBAAkB,WACrB,sBAAsB,YACpB,MAAM,KACf,MAGF,CAAC"}
@@ -1,5 +0,0 @@
1
- export const resolveCallbackUrl = (config, baseUrl) => {
2
- const callbackUrl = new URL(config?.callbackUrl, baseUrl).toString();
3
- return callbackUrl.toString();
4
- };
5
- //# sourceMappingURL=utils.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/nextjs/utils.ts"],"names":[],"mappings":"AAEA,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,MAA8B,EAC9B,OAAgB,EACR,EAAE;IACV,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,MAAM,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;IACrE,OAAO,WAAW,CAAC,QAAQ,EAAE,CAAC;AAChC,CAAC,CAAC","sourcesContent":["import type { AuthConfigWithDefaults } from \"@/nextjs/config.js\";\n\nexport const resolveCallbackUrl = (\n config: AuthConfigWithDefaults,\n baseUrl?: string,\n): string => {\n const callbackUrl = new URL(config?.callbackUrl, baseUrl).toString();\n return callbackUrl.toString();\n};\n"]}
@@ -1,8 +0,0 @@
1
- import React from "react";
2
- import type { DisplayMode } from "@/types.js";
3
- declare const SignInButton: ({ displayMode, className, }: {
4
- displayMode?: DisplayMode;
5
- className?: string;
6
- }) => React.JSX.Element;
7
- export { SignInButton };
8
- //# sourceMappingURL=SignInButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignInButton.d.ts","sourceRoot":"","sources":["../../../../../src/reactjs/components/SignInButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAG9C,QAAA,MAAM,YAAY,gCAGf;IACD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAeA,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- "use client";
2
- import React from "react";
3
- import { cn } from "@/utils.js";
4
- import { useUser } from "@/reactjs/hooks/useUser.js";
5
- const SignInButton = ({ displayMode, className, }) => {
6
- const { signIn } = useUser();
7
- return (React.createElement("button", { "data-testid": "sign-in-button", className: cn("cac-rounded-full cac-border cac-border-neutral-500 cac-px-3 cac-py-2 cac-transition-colors hover:cac-bg-neutral-200 hover:cac-bg-opacity-50", className), onClick: () => signIn(displayMode) }, "Sign In"));
8
- };
9
- export { SignInButton };
10
- //# sourceMappingURL=SignInButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignInButton.js","sourceRoot":"","sources":["../../../../../src/reactjs/components/SignInButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,MAAM,YAAY,GAAG,CAAC,EACpB,WAAW,EACX,SAAS,GAIV,EAAE,EAAE;IACH,MAAM,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,CAAC;IAE7B,OAAO,CACL,+CACc,gBAAgB,EAC5B,SAAS,EAAE,EAAE,CACX,6IAA6I,EAC7I,SAAS,CACV,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC,cAG3B,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,YAAY,EAAE,CAAC","sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { cn } from \"@/utils.js\";\nimport type { DisplayMode } from \"@/types.js\";\nimport { useUser } from \"@/reactjs/hooks/useUser.js\";\n\nconst SignInButton = ({\n displayMode,\n className,\n}: {\n displayMode?: DisplayMode;\n className?: string;\n}) => {\n const { signIn } = useUser();\n\n return (\n <button\n data-testid=\"sign-in-button\"\n className={cn(\n \"cac-rounded-full cac-border cac-border-neutral-500 cac-px-3 cac-py-2 cac-transition-colors hover:cac-bg-neutral-200 hover:cac-bg-opacity-50\",\n className,\n )}\n onClick={() => signIn(displayMode)}\n >\n Sign In\n </button>\n );\n};\n\nexport { SignInButton };\n"]}
@@ -1,6 +0,0 @@
1
- import React from "react";
2
- declare const SignOutButton: ({ className }: {
3
- className?: string;
4
- }) => React.JSX.Element;
5
- export { SignOutButton };
6
- //# sourceMappingURL=SignOutButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignOutButton.d.ts","sourceRoot":"","sources":["../../../../../src/reactjs/components/SignOutButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,QAAA,MAAM,aAAa,kBAAmB;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,sBAc3D,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC"}
@@ -1,10 +0,0 @@
1
- "use client";
2
- import React from "react";
3
- import { cn } from "@/utils.js";
4
- import { useUser } from "@/reactjs/hooks/useUser.js";
5
- const SignOutButton = ({ className }) => {
6
- const { signOut } = useUser();
7
- return (React.createElement("button", { className: cn("cac-rounded-full cac-border cac-border-neutral-500 cac-px-3 cac-py-2 cac-transition-colors hover:cac-bg-neutral-200 hover:cac-bg-opacity-50", className), onClick: () => signOut() }, "Sign Out"));
8
- };
9
- export { SignOutButton };
10
- //# sourceMappingURL=SignOutButton.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"SignOutButton.js","sourceRoot":"","sources":["../../../../../src/reactjs/components/SignOutButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;AACb,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,EAAE,EAAE,MAAM,YAAY,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAC;AAErD,MAAM,aAAa,GAAG,CAAC,EAAE,SAAS,EAA0B,EAAE,EAAE;IAC9D,MAAM,EAAE,OAAO,EAAE,GAAG,OAAO,EAAE,CAAC;IAE9B,OAAO,CACL,gCACE,SAAS,EAAE,EAAE,CACX,6IAA6I,EAC7I,SAAS,CACV,EACD,OAAO,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,eAGjB,CACV,CAAC;AACJ,CAAC,CAAC;AAEF,OAAO,EAAE,aAAa,EAAE,CAAC","sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { cn } from \"@/utils.js\";\nimport { useUser } from \"@/reactjs/hooks/useUser.js\";\n\nconst SignOutButton = ({ className }: { className?: string }) => {\n const { signOut } = useUser();\n\n return (\n <button\n className={cn(\n \"cac-rounded-full cac-border cac-border-neutral-500 cac-px-3 cac-py-2 cac-transition-colors hover:cac-bg-neutral-200 hover:cac-bg-opacity-50\",\n className,\n )}\n onClick={() => signOut()}\n >\n Sign Out\n </button>\n );\n};\n\nexport { SignOutButton };\n"]}
@@ -1,8 +0,0 @@
1
- import type { DisplayMode } from "@/types.js";
2
- import React from "react";
3
- declare const UserButton: ({ displayMode, className, }: {
4
- displayMode?: DisplayMode;
5
- className?: string;
6
- }) => React.JSX.Element;
7
- export { UserButton };
8
- //# sourceMappingURL=UserButton.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"UserButton.d.ts","sourceRoot":"","sources":["../../../../../src/reactjs/components/UserButton.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,KAA2C,MAAM,OAAO,CAAC;AAoChE,QAAA,MAAM,UAAU,gCAGb;IACD,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,sBAwGA,CAAC;AAEF,OAAO,EAAE,UAAU,EAAE,CAAC"}