@civic/auth 0.0.1-tsc.alpha.2 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (183) hide show
  1. package/.turbo/turbo-build.log +3 -3
  2. package/.turbo/turbo-lint.log +2 -2
  3. package/.turbo/turbo-test.log +1364 -0
  4. package/CHANGELOG.md +2 -0
  5. package/dist/cjs/src/browser/storage.d.ts +2 -2
  6. package/dist/cjs/src/browser/storage.d.ts.map +1 -1
  7. package/dist/cjs/src/browser/storage.js +3 -3
  8. package/dist/cjs/src/browser/storage.js.map +1 -1
  9. package/dist/cjs/src/nextjs/GetUser.d.ts +1 -1
  10. package/dist/cjs/src/nextjs/GetUser.d.ts.map +1 -1
  11. package/dist/cjs/src/nextjs/GetUser.js +3 -3
  12. package/dist/cjs/src/nextjs/GetUser.js.map +1 -1
  13. package/dist/cjs/src/nextjs/config.d.ts.map +1 -1
  14. package/dist/cjs/src/nextjs/config.js +0 -2
  15. package/dist/cjs/src/nextjs/config.js.map +1 -1
  16. package/dist/cjs/src/nextjs/cookies.d.ts +4 -4
  17. package/dist/cjs/src/nextjs/cookies.d.ts.map +1 -1
  18. package/dist/cjs/src/nextjs/cookies.js +14 -11
  19. package/dist/cjs/src/nextjs/cookies.js.map +1 -1
  20. package/dist/cjs/src/nextjs/index.d.ts +1 -1
  21. package/dist/cjs/src/nextjs/index.d.ts.map +1 -1
  22. package/dist/cjs/src/nextjs/index.js +1 -3
  23. package/dist/cjs/src/nextjs/index.js.map +1 -1
  24. package/dist/cjs/src/nextjs/routeHandler.d.ts.map +1 -1
  25. package/dist/cjs/src/nextjs/routeHandler.js +1 -5
  26. package/dist/cjs/src/nextjs/routeHandler.js.map +1 -1
  27. package/dist/cjs/src/reactjs/components/UserButton.d.ts.map +1 -1
  28. package/dist/cjs/src/reactjs/components/UserButton.js +25 -12
  29. package/dist/cjs/src/reactjs/components/UserButton.js.map +1 -1
  30. package/dist/cjs/src/reactjs/hooks/index.d.ts +0 -2
  31. package/dist/cjs/src/reactjs/hooks/index.d.ts.map +1 -1
  32. package/dist/cjs/src/reactjs/hooks/index.js +1 -5
  33. package/dist/cjs/src/reactjs/hooks/index.js.map +1 -1
  34. package/dist/cjs/src/server/ServerAuthenticationResolver.d.ts.map +1 -1
  35. package/dist/cjs/src/server/ServerAuthenticationResolver.js +2 -7
  36. package/dist/cjs/src/server/ServerAuthenticationResolver.js.map +1 -1
  37. package/dist/cjs/src/server/login.d.ts +2 -2
  38. package/dist/cjs/src/server/login.d.ts.map +1 -1
  39. package/dist/cjs/src/server/login.js +2 -2
  40. package/dist/cjs/src/server/login.js.map +1 -1
  41. package/dist/cjs/src/services/AuthenticationService.d.ts.map +1 -1
  42. package/dist/cjs/src/services/AuthenticationService.js +6 -16
  43. package/dist/cjs/src/services/AuthenticationService.js.map +1 -1
  44. package/dist/cjs/src/shared/components/CivicAuthIframeContainer.d.ts.map +1 -1
  45. package/dist/cjs/src/shared/components/CivicAuthIframeContainer.js +0 -2
  46. package/dist/cjs/src/shared/components/CivicAuthIframeContainer.js.map +1 -1
  47. package/dist/cjs/src/shared/components/LoadingIcon.d.ts.map +1 -1
  48. package/dist/cjs/src/shared/components/LoadingIcon.js +6 -0
  49. package/dist/cjs/src/shared/components/LoadingIcon.js.map +1 -1
  50. package/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.d.ts.map +1 -1
  51. package/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.js +2 -6
  52. package/dist/cjs/src/shared/lib/GenericAuthenticationRefresher.js.map +1 -1
  53. package/dist/cjs/src/shared/lib/UserSession.d.ts +4 -4
  54. package/dist/cjs/src/shared/lib/UserSession.d.ts.map +1 -1
  55. package/dist/cjs/src/shared/lib/UserSession.js +4 -4
  56. package/dist/cjs/src/shared/lib/UserSession.js.map +1 -1
  57. package/dist/cjs/src/shared/lib/session.js +1 -1
  58. package/dist/cjs/src/shared/lib/session.js.map +1 -1
  59. package/dist/cjs/src/shared/lib/storage.d.ts +2 -2
  60. package/dist/cjs/src/shared/lib/storage.d.ts.map +1 -1
  61. package/dist/cjs/src/shared/lib/storage.js.map +1 -1
  62. package/dist/cjs/src/shared/lib/util.d.ts +4 -4
  63. package/dist/cjs/src/shared/lib/util.d.ts.map +1 -1
  64. package/dist/cjs/src/shared/lib/util.js +16 -17
  65. package/dist/cjs/src/shared/lib/util.js.map +1 -1
  66. package/dist/cjs/src/types.d.ts +2 -2
  67. package/dist/cjs/src/types.d.ts.map +1 -1
  68. package/dist/cjs/src/types.js.map +1 -1
  69. package/dist/cjs/tsconfig.cjs.tsbuildinfo +1 -1
  70. package/dist/esm/src/browser/storage.d.ts +2 -2
  71. package/dist/esm/src/browser/storage.d.ts.map +1 -1
  72. package/dist/esm/src/browser/storage.js +3 -3
  73. package/dist/esm/src/browser/storage.js.map +1 -1
  74. package/dist/esm/src/nextjs/GetUser.d.ts +1 -1
  75. package/dist/esm/src/nextjs/GetUser.d.ts.map +1 -1
  76. package/dist/esm/src/nextjs/GetUser.js +3 -3
  77. package/dist/esm/src/nextjs/GetUser.js.map +1 -1
  78. package/dist/esm/src/nextjs/config.d.ts.map +1 -1
  79. package/dist/esm/src/nextjs/config.js +0 -2
  80. package/dist/esm/src/nextjs/config.js.map +1 -1
  81. package/dist/esm/src/nextjs/cookies.d.ts +4 -4
  82. package/dist/esm/src/nextjs/cookies.d.ts.map +1 -1
  83. package/dist/esm/src/nextjs/cookies.js +14 -11
  84. package/dist/esm/src/nextjs/cookies.js.map +1 -1
  85. package/dist/esm/src/nextjs/index.d.ts +1 -1
  86. package/dist/esm/src/nextjs/index.d.ts.map +1 -1
  87. package/dist/esm/src/nextjs/index.js +1 -1
  88. package/dist/esm/src/nextjs/index.js.map +1 -1
  89. package/dist/esm/src/nextjs/routeHandler.d.ts.map +1 -1
  90. package/dist/esm/src/nextjs/routeHandler.js +1 -5
  91. package/dist/esm/src/nextjs/routeHandler.js.map +1 -1
  92. package/dist/esm/src/reactjs/components/UserButton.d.ts.map +1 -1
  93. package/dist/esm/src/reactjs/components/UserButton.js +26 -13
  94. package/dist/esm/src/reactjs/components/UserButton.js.map +1 -1
  95. package/dist/esm/src/reactjs/hooks/index.d.ts +0 -2
  96. package/dist/esm/src/reactjs/hooks/index.d.ts.map +1 -1
  97. package/dist/esm/src/reactjs/hooks/index.js +0 -2
  98. package/dist/esm/src/reactjs/hooks/index.js.map +1 -1
  99. package/dist/esm/src/server/ServerAuthenticationResolver.d.ts.map +1 -1
  100. package/dist/esm/src/server/ServerAuthenticationResolver.js +2 -7
  101. package/dist/esm/src/server/ServerAuthenticationResolver.js.map +1 -1
  102. package/dist/esm/src/server/login.d.ts +2 -2
  103. package/dist/esm/src/server/login.d.ts.map +1 -1
  104. package/dist/esm/src/server/login.js +2 -2
  105. package/dist/esm/src/server/login.js.map +1 -1
  106. package/dist/esm/src/services/AuthenticationService.d.ts.map +1 -1
  107. package/dist/esm/src/services/AuthenticationService.js +6 -16
  108. package/dist/esm/src/services/AuthenticationService.js.map +1 -1
  109. package/dist/esm/src/shared/components/CivicAuthIframeContainer.d.ts.map +1 -1
  110. package/dist/esm/src/shared/components/CivicAuthIframeContainer.js +0 -2
  111. package/dist/esm/src/shared/components/CivicAuthIframeContainer.js.map +1 -1
  112. package/dist/esm/src/shared/components/LoadingIcon.d.ts.map +1 -1
  113. package/dist/esm/src/shared/components/LoadingIcon.js +6 -0
  114. package/dist/esm/src/shared/components/LoadingIcon.js.map +1 -1
  115. package/dist/esm/src/shared/lib/GenericAuthenticationRefresher.d.ts.map +1 -1
  116. package/dist/esm/src/shared/lib/GenericAuthenticationRefresher.js +2 -6
  117. package/dist/esm/src/shared/lib/GenericAuthenticationRefresher.js.map +1 -1
  118. package/dist/esm/src/shared/lib/UserSession.d.ts +4 -4
  119. package/dist/esm/src/shared/lib/UserSession.d.ts.map +1 -1
  120. package/dist/esm/src/shared/lib/UserSession.js +4 -4
  121. package/dist/esm/src/shared/lib/UserSession.js.map +1 -1
  122. package/dist/esm/src/shared/lib/session.js +1 -1
  123. package/dist/esm/src/shared/lib/session.js.map +1 -1
  124. package/dist/esm/src/shared/lib/storage.d.ts +2 -2
  125. package/dist/esm/src/shared/lib/storage.d.ts.map +1 -1
  126. package/dist/esm/src/shared/lib/storage.js.map +1 -1
  127. package/dist/esm/src/shared/lib/util.d.ts +4 -4
  128. package/dist/esm/src/shared/lib/util.d.ts.map +1 -1
  129. package/dist/esm/src/shared/lib/util.js +16 -17
  130. package/dist/esm/src/shared/lib/util.js.map +1 -1
  131. package/dist/esm/src/types.d.ts +2 -2
  132. package/dist/esm/src/types.d.ts.map +1 -1
  133. package/dist/esm/src/types.js.map +1 -1
  134. package/dist/esm/tsconfig.esm.tsbuildinfo +1 -1
  135. package/dist/src/nextjs/index.d.ts +1 -1
  136. package/dist/src/nextjs/index.d.ts.map +1 -1
  137. package/dist/src/nextjs/index.js +1 -1
  138. package/dist/src/nextjs/index.js.map +1 -1
  139. package/dist/src/reactjs/components/UserButton.d.ts.map +1 -1
  140. package/dist/src/reactjs/components/UserButton.js +26 -13
  141. package/dist/src/reactjs/components/UserButton.js.map +1 -1
  142. package/dist/src/reactjs/hooks/index.d.ts +0 -1
  143. package/dist/src/reactjs/hooks/index.d.ts.map +1 -1
  144. package/dist/src/reactjs/hooks/index.js +0 -1
  145. package/dist/src/reactjs/hooks/index.js.map +1 -1
  146. package/dist/src/shared/lib/util.d.ts.map +1 -1
  147. package/dist/src/shared/lib/util.js +0 -2
  148. package/dist/src/shared/lib/util.js.map +1 -1
  149. package/dist/tsconfig.tsbuildinfo +1 -1
  150. package/dist/vitest.config.js +3 -3
  151. package/dist/vitest.config.js.map +1 -1
  152. package/package.json +3 -3
  153. package/src/browser/storage.ts +3 -3
  154. package/src/nextjs/GetUser.ts +3 -3
  155. package/src/nextjs/config.ts +0 -2
  156. package/src/nextjs/cookies.ts +14 -18
  157. package/src/nextjs/index.ts +1 -5
  158. package/src/nextjs/routeHandler.ts +1 -5
  159. package/src/reactjs/components/UserButton.tsx +34 -10
  160. package/src/reactjs/hooks/index.ts +0 -2
  161. package/src/server/ServerAuthenticationResolver.ts +2 -7
  162. package/src/server/login.ts +8 -7
  163. package/src/services/AuthenticationService.ts +6 -16
  164. package/src/shared/components/CivicAuthIframeContainer.tsx +0 -4
  165. package/src/shared/components/LoadingIcon.tsx +8 -0
  166. package/src/shared/lib/GenericAuthenticationRefresher.ts +3 -8
  167. package/src/shared/lib/UserSession.ts +6 -6
  168. package/src/shared/lib/session.ts +1 -1
  169. package/src/shared/lib/storage.ts +2 -2
  170. package/src/shared/lib/util.ts +21 -21
  171. package/src/types.ts +2 -2
  172. package/test/unit/nextjs/getUser.test.ts +8 -8
  173. package/test/unit/nextjs/{routeHandler.test.ts → routeHandler.test.ts.skipped} +1 -1
  174. package/test/unit/publicApi/__snapshots__/apiSnapshot.test.ts.snap +0 -2
  175. package/test/unit/server/login.test.ts +20 -18
  176. package/test/unit/server/session.test.ts +4 -4
  177. package/test/unit/services/AuthenticationService.test.ts +3 -3
  178. package/test/unit/services/ServerAuthenticationResolver.test.ts +11 -6
  179. package/test/unit/shared/GenericAuthenticationRefresher.test.ts +4 -4
  180. package/test/unit/shared/UserSession.test.ts +6 -6
  181. package/test/unit/shared/storage.test.ts +6 -6
  182. package/vitest.config.ts +3 -3
  183. package/src/nextjs/client/index.ts +0 -4
@@ -0,0 +1,1364 @@
1
+
2
+ 
3
+ > @civic/auth@0.0.1-beta.26 test /Users/flippie/civic/repos/civic-auth/packages/civic-auth-client
4
+ > vitest "--run" "--coverage"
5
+
6
+
7
+  RUN  v2.1.2 /Users/flippie/civic/repos/civic-auth/packages/civic-auth-client
8
+  Coverage enabled with v8
9
+
10
+ [?25l · test/unit/logger.test.ts (11)
11
+ [?25l[?25l ✓ test/unit/logger.test.ts (11)
12
+ [?25l[?25l[?25l[?25lstdout | test/unit/nextjs/config.test.ts
13
+ process.env.NODE_ENV: development
14
+ defaultServerSecure: false
15
+
16
+ [?25l · test/unit/nextjs/config.test.ts (10)
17
+ ✓ test/unit/logger.test.ts (11)
18
+ · test/unit/shared/storage.test.ts (3)
19
+ · test/unit/utils.test.ts (4)
20
+ stdout | test/unit/nextjs/middleware.test.ts
21
+ process.env.NODE_ENV: development
22
+ defaultServerSecure: false
23
+
24
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > authMiddleware > should allow access when token is present
25
+ matching { pattern: '/*', pathname: '/protected', match: true }
26
+ → Auth check passed
27
+
28
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > authMiddleware > should skip auth check for redirect to login page
29
+ → Skipping auth check - this is the login URL
30
+
31
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > authMiddleware > should not skip auth check for non-GET to login page
32
+ matching { pattern: '/*', pathname: '/login', match: true }
33
+ → No valid token found - redirecting to login URL {}
34
+
35
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > withAuth > should chain custom middleware when authenticated
36
+ matching { pattern: '/*', pathname: '/protected', match: true }
37
+ → Auth check passed
38
+
39
+ [?25l · test/unit/nextjs/config.test.ts (10)
40
+ ✓ test/unit/logger.test.ts (11)
41
+ · test/unit/nextjs/middleware.test.ts (7)
42
+ · test/unit/shared/storage.test.ts (3)
43
+ · test/unit/utils.test.ts (4)
44
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > withAuth > should not chain custom middleware when unauthorized
45
+ matching { pattern: '/*', pathname: '/protected', match: true }
46
+ → No valid token found - redirecting to login URL {}
47
+
48
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > path matching > should respect include patterns
49
+ matching { pattern: '/protected/**', pathname: '/public', match: false }
50
+ → Skipping auth check - path not in include patterns
51
+
52
+ stdout | test/unit/nextjs/middleware.test.ts > Auth Middleware > path matching > should respect exclude patterns
53
+ matching {
54
+ pattern: '/protected/**',
55
+ pathname: '/protected/public',
56
+ match: true
57
+ }
58
+ matching {
59
+ pattern: '/protected/public',
60
+ pathname: '/protected/public',
61
+ match: true
62
+ }
63
+ → Skipping auth check - path in exclude patterns
64
+
65
+ stdout | test/unit/nextjs/config.test.ts > nextjs/config > resolveAuthConfig > should set secure to true in the default cookie configs if NODE_ENV is not development
66
+ process.env.NODE_ENV: production
67
+ defaultServerSecure: true
68
+
69
+ [?25l ❯ test/unit/nextjs/config.test.ts (10)
70
+ ❯ nextjs/config (10)
71
+ ❯ resolveAuthConfig (7)
72
+ ✓ should throw an error if clientId is not provided
73
+ ✓ should use default values when no config is provided
74
+ ✓ should override default values with provided config
75
+ ✓ should use environment variables if set
76
+ ✓ should prioritize provided config over environment variables
77
+ ✓ should merge cookie configurations correctly
78
+ ⠙ should set secure to true in the default cookie configs if NODE_ENV is not development
79
+ · createCivicAuthPlugin (3)
80
+ ✓ test/unit/logger.test.ts (11)
81
+ · test/unit/nextjs/middleware.test.ts (7)
82
+ · test/unit/shared/storage.test.ts (3)
83
+ · test/unit/utils.test.ts (4)
84
+ [?25l ❯ test/unit/nextjs/config.test.ts (10)
85
+ ❯ nextjs/config (10)
86
+ ❯ resolveAuthConfig (7)
87
+ ✓ should throw an error if clientId is not provided
88
+ ✓ should use default values when no config is provided
89
+ ✓ should override default values with provided config
90
+ ✓ should use environment variables if set
91
+ ✓ should prioritize provided config over environment variables
92
+ ✓ should merge cookie configurations correctly
93
+ ⠹ should set secure to true in the default cookie configs if NODE_ENV is not development
94
+ · createCivicAuthPlugin (3)
95
+ ✓ test/unit/logger.test.ts (11)
96
+ · test/unit/nextjs/middleware.test.ts (7)
97
+ ✓ test/unit/shared/storage.test.ts (3)
98
+ ✓ test/unit/utils.test.ts (4)
99
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
100
+ ✓ test/unit/logger.test.ts (11)
101
+ ✓ test/unit/nextjs/middleware.test.ts (7)
102
+ ✓ test/unit/shared/storage.test.ts (3)
103
+ ✓ test/unit/utils.test.ts (4)
104
+ [?25l[?25l[?25l[?25l[?25l[?25l[?25l ✓ test/unit/nextjs/config.test.ts (10)
105
+ ✓ test/unit/logger.test.ts (11)
106
+ ✓ test/unit/nextjs/middleware.test.ts (7)
107
+ · test/unit/services/ServerAuthenticationResolver.test.ts (5)
108
+ · test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
109
+ · test/unit/lib/oauth.test.ts (6)
110
+ ✓ test/unit/shared/storage.test.ts (3)
111
+ ✓ test/unit/utils.test.ts (4)
112
+ stdout | test/unit/shared/GenericAuthenticationRefresher.test.ts > GenericAuthenticationRefresher > init > should initialize OAuth2 client with resolved endpoints
113
+ GenericAuthenticationRefresher constructor {
114
+ authConfig: {
115
+ clientId: 'mockClientId',
116
+ oauthServer: 'http://mockOauthServer',
117
+ redirectUrl: 'http://localhost/redirect'
118
+ },
119
+ endpointOverrides: undefined
120
+ }
121
+
122
+ stdout | test/unit/shared/GenericAuthenticationRefresher.test.ts > GenericAuthenticationRefresher > refreshTokens > should refresh tokens and store them
123
+ GenericAuthenticationRefresher constructor {
124
+ authConfig: {
125
+ clientId: 'mockClientId',
126
+ oauthServer: 'http://mockOauthServer',
127
+ redirectUrl: 'http://localhost/redirect'
128
+ },
129
+ endpointOverrides: undefined
130
+ }
131
+
132
+ stdout | test/unit/shared/GenericAuthenticationRefresher.test.ts > GenericAuthenticationRefresher > refreshTokens > should throw an error if no refresh token is available
133
+ GenericAuthenticationRefresher constructor {
134
+ authConfig: {
135
+ clientId: 'mockClientId',
136
+ oauthServer: 'http://mockOauthServer',
137
+ redirectUrl: 'http://localhost/redirect'
138
+ },
139
+ endpointOverrides: undefined
140
+ }
141
+
142
+ stderr | test/unit/lib/oauth.test.ts > displayModeFromState > should return the display mode from the state
143
+ Failed to parse displayMode from state: state DOMException [InvalidCharacterError]: The string to be decoded is not correctly encoded.
144
+  at atob (node:buffer:1296:13)
145
+ at Module.displayModeFromState (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/lib/oauth.ts:59:24)
146
+ at /Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/test/unit/lib/oauth.test.ts:42:20
147
+ at file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:146:14
148
+ at file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:533:11
149
+ at runWithTimeout (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:61:7)
150
+ at runTest (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:986:17)
151
+  at processTicksAndRejections (node:internal/process/task_queues:105:5)
152
+ at runSuite (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:1142:15)
153
+ at runSuite (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:1142:15)
154
+
155
+ stdout | test/unit/services/ServerAuthenticationResolver.test.ts > ServerAuthenticationResolver > init > should initialize OAuth2 client with resolved endpoints
156
+ ServerAuthenticationResolver constructor {
157
+ authConfig: {
158
+ clientId: 'mockClientId',
159
+ oauthServer: 'http://mockOauthServer',
160
+ redirectUrl: 'http://localhost/redirect',
161
+ challengeUrl: 'http://localhost/challenge'
162
+ },
163
+ storage: {},
164
+ endpointOverrides: undefined
165
+ }
166
+
167
+ stdout | test/unit/services/ServerAuthenticationResolver.test.ts > ServerAuthenticationResolver > tokenExchange > should exchange auth code for tokens and store them
168
+ ServerAuthenticationResolver constructor {
169
+ authConfig: {
170
+ clientId: 'mockClientId',
171
+ oauthServer: 'http://mockOauthServer',
172
+ redirectUrl: 'http://localhost/redirect',
173
+ challengeUrl: 'http://localhost/challenge'
174
+ },
175
+ storage: {},
176
+ endpointOverrides: undefined
177
+ }
178
+
179
+ stdout | test/unit/services/ServerAuthenticationResolver.test.ts > ServerAuthenticationResolver > tokenExchange > should throw an error if code verifier is not found
180
+ ServerAuthenticationResolver constructor {
181
+ authConfig: {
182
+ clientId: 'mockClientId',
183
+ oauthServer: 'http://mockOauthServer',
184
+ redirectUrl: 'http://localhost/redirect',
185
+ challengeUrl: 'http://localhost/challenge'
186
+ },
187
+ storage: {},
188
+ endpointOverrides: undefined
189
+ }
190
+
191
+ stdout | test/unit/services/ServerAuthenticationResolver.test.ts > ServerAuthenticationResolver > getSessionData > should retrieve session data from storage
192
+ ServerAuthenticationResolver constructor {
193
+ authConfig: {
194
+ clientId: 'mockClientId',
195
+ oauthServer: 'http://mockOauthServer',
196
+ redirectUrl: 'http://localhost/redirect',
197
+ challengeUrl: 'http://localhost/challenge'
198
+ },
199
+ storage: {},
200
+ endpointOverrides: undefined
201
+ }
202
+
203
+ stdout | test/unit/services/ServerAuthenticationResolver.test.ts > ServerAuthenticationResolver > getSessionData > should return null if no tokens are found in storage
204
+ ServerAuthenticationResolver constructor {
205
+ authConfig: {
206
+ clientId: 'mockClientId',
207
+ oauthServer: 'http://mockOauthServer',
208
+ redirectUrl: 'http://localhost/redirect',
209
+ challengeUrl: 'http://localhost/challenge'
210
+ },
211
+ storage: {},
212
+ endpointOverrides: undefined
213
+ }
214
+
215
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
216
+ ✓ test/unit/logger.test.ts (11)
217
+ · test/unit/services/AuthenticationService.test.ts (6)
218
+ ✓ test/unit/nextjs/middleware.test.ts (7)
219
+ · test/unit/services/ServerAuthenticationResolver.test.ts (5)
220
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
221
+ ✓ test/unit/lib/oauth.test.ts (6)
222
+ ✓ test/unit/shared/storage.test.ts (3)
223
+ · test/unit/server/session.test.ts (3)
224
+ ✓ test/unit/utils.test.ts (4)
225
+ [?25lstdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationInitiator > should generate a login URL
226
+ BrowserAuthenticationInitiator constructor {
227
+ clientId: 'mockClientId',
228
+ redirectUrl: 'http://localhost/redirect',
229
+ state: 'mockState',
230
+ scopes: [ 'openid', 'profile' ],
231
+ displayMode: 'redirect',
232
+ oauthServer: 'http://mockOauthServer',
233
+ pkceConsumer: {}
234
+ }
235
+
236
+ stderr | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationInitiator > should generate a login URL
237
+ Error: Not implemented: navigation (except hash changes)
238
+ at module.exports (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/browser/not-implemented.js:9:17)
239
+ at navigateFetch (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/window/navigation.js:77:3)
240
+ at exports.navigate (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/window/navigation.js:55:3)
241
+ at LocationImpl._locationObjectNavigate (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:31:5)
242
+ at LocationImpl._locationObjectSetterNavigate (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:25:17)
243
+ at LocationImpl.set href [as href] (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/window/Location-impl.js:47:10)
244
+ at Location.set href [as href] (/Users/flippie/civic/repos/civic-auth/node_modules/jsdom/lib/jsdom/living/generated/Location.js:125:37)
245
+ at BrowserAuthenticationInitiator.signIn (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/services/AuthenticationService.ts:115:23)
246
+ at processTicksAndRejections (node:internal/process/task_queues:105:5)
247
+ at /Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/test/unit/services/AuthenticationService.test.ts:54:19 undefined
248
+
249
+ stdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationInitiator > should generate a logout URL
250
+ BrowserAuthenticationInitiator constructor {
251
+ clientId: 'mockClientId',
252
+ redirectUrl: 'http://localhost/redirect',
253
+ state: 'mockState',
254
+ scopes: [ 'openid', 'profile' ],
255
+ displayMode: 'redirect',
256
+ oauthServer: 'http://mockOauthServer',
257
+ pkceConsumer: {}
258
+ }
259
+
260
+ stdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > GenericAuthenticationInitiator > should generate a login URL
261
+ GenericAuthenticationInitiator constructor {
262
+ config: {
263
+ clientId: 'mockClientId',
264
+ redirectUrl: 'http://localhost/redirect',
265
+ state: 'mockState',
266
+ scopes: [ 'openid', 'profile' ],
267
+ displayMode: 'redirect',
268
+ oauthServer: 'http://mockOauthServer',
269
+ pkceConsumer: {}
270
+ }
271
+ }
272
+
273
+ stdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > GenericAuthenticationInitiator > should generate a logout URL
274
+ GenericAuthenticationInitiator constructor {
275
+ config: {
276
+ clientId: 'mockClientId',
277
+ redirectUrl: 'http://localhost/redirect',
278
+ state: 'mockState',
279
+ scopes: [ 'openid', 'profile' ],
280
+ displayMode: 'redirect',
281
+ oauthServer: 'http://mockOauthServer',
282
+ pkceConsumer: {}
283
+ }
284
+ }
285
+
286
+ stdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationService > should exchange auth code for tokens and store them
287
+ BrowserAuthenticationService constructor {
288
+ config: {
289
+ clientId: 'mockClientId',
290
+ redirectUrl: 'http://localhost/redirect',
291
+ state: 'mockState',
292
+ scopes: [ 'openid', 'profile' ],
293
+ displayMode: 'redirect',
294
+ oauthServer: 'http://mockOauthServer'
295
+ }
296
+ }
297
+ BrowserAuthenticationInitiator constructor {
298
+ clientId: 'mockClientId',
299
+ redirectUrl: 'http://localhost/redirect',
300
+ state: 'eyJ1dWlkIjoiNWUzZjNkOTMtNmQxYi00Yzg4LWJjNTgtYTA1ODY0NjZiMDU4IiwiZGlzcGxheU1vZGUiOiJyZWRpcmVjdCJ9',
301
+ scopes: [ 'openid', 'profile' ],
302
+ displayMode: 'redirect',
303
+ oauthServer: 'http://mockOauthServer',
304
+ pkceConsumer: BrowserPublicClientPKCEProducer {
305
+ constructor: [Function: BrowserPublicClientPKCEProducer] {
306
+ getMockName: [Function (anonymous)],
307
+ mockName: [Function (anonymous)],
308
+ mockClear: [Function (anonymous)],
309
+ mockReset: [Function (anonymous)],
310
+ mockRestore: [Function (anonymous)],
311
+ getMockImplementation: [Function (anonymous)],
312
+ mockImplementation: [Function (anonymous)],
313
+ mockImplementationOnce: [Function (anonymous)],
314
+ withImplementation: [Function: withImplementation],
315
+ mockReturnThis: [Function (anonymous)],
316
+ mockReturnValue: [Function (anonymous)],
317
+ mockReturnValueOnce: [Function (anonymous)],
318
+ mockResolvedValue: [Function (anonymous)],
319
+ mockResolvedValueOnce: [Function (anonymous)],
320
+ mockRejectedValue: [Function (anonymous)],
321
+ mockRejectedValueOnce: [Function (anonymous)]
322
+ },
323
+ getCodeChallenge: [Function: getCodeChallenge] {
324
+ getMockName: [Function (anonymous)],
325
+ mockName: [Function (anonymous)],
326
+ mockClear: [Function (anonymous)],
327
+ mockReset: [Function (anonymous)],
328
+ mockRestore: [Function (anonymous)],
329
+ getMockImplementation: [Function (anonymous)],
330
+ mockImplementation: [Function (anonymous)],
331
+ mockImplementationOnce: [Function (anonymous)],
332
+ withImplementation: [Function: withImplementation],
333
+ mockReturnThis: [Function (anonymous)],
334
+ mockReturnValue: [Function (anonymous)],
335
+ mockReturnValueOnce: [Function (anonymous)],
336
+ mockResolvedValue: [Function (anonymous)],
337
+ mockResolvedValueOnce: [Function (anonymous)],
338
+ mockRejectedValue: [Function (anonymous)],
339
+ mockRejectedValueOnce: [Function (anonymous)]
340
+ },
341
+ getCodeVerifier: [Function: getCodeVerifier] {
342
+ getMockName: [Function (anonymous)],
343
+ mockName: [Function (anonymous)],
344
+ mockClear: [Function (anonymous)],
345
+ mockReset: [Function (anonymous)],
346
+ mockRestore: [Function (anonymous)],
347
+ getMockImplementation: [Function (anonymous)],
348
+ mockImplementation: [Function (anonymous)],
349
+ mockImplementationOnce: [Function (anonymous)],
350
+ withImplementation: [Function: withImplementation],
351
+ mockReturnThis: [Function (anonymous)],
352
+ mockReturnValue: [Function (anonymous)],
353
+ mockReturnValueOnce: [Function (anonymous)],
354
+ mockResolvedValue: [Function (anonymous)],
355
+ mockResolvedValueOnce: [Function (anonymous)],
356
+ mockRejectedValue: [Function (anonymous)],
357
+ mockRejectedValueOnce: [Function (anonymous)]
358
+ }
359
+ }
360
+ }
361
+
362
+ stderr | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationService > should exchange auth code for tokens and store them
363
+ Failed to parse displayMode from state: mockState DOMException [InvalidCharacterError]: The string to be decoded is not correctly encoded.
364
+  at atob (node:buffer:1296:13)
365
+ at Module.displayModeFromState (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/lib/oauth.ts:59:24)
366
+ at BrowserAuthenticationService.tokenExchange (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/services/AuthenticationService.ts:266:31)
367
+  at processTicksAndRejections (node:internal/process/task_queues:105:5)
368
+ at /Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/test/unit/services/AuthenticationService.test.ts:128:22
369
+ at file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:533:5
370
+ at runTest (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:986:11)
371
+ at runSuite (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:1142:15)
372
+ at runSuite (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:1142:15)
373
+ at runSuite (file:///Users/flippie/civic/repos/civic-auth/node_modules/@vitest/runner/dist/index.js:1142:15)
374
+
375
+ stdout | test/unit/services/AuthenticationService.test.ts > Authentication Services > BrowserAuthenticationService > should retrieve session data from local storage
376
+ BrowserAuthenticationService constructor {
377
+ config: {
378
+ clientId: 'mockClientId',
379
+ redirectUrl: 'http://localhost/redirect',
380
+ state: 'mockState',
381
+ scopes: [ 'openid', 'profile' ],
382
+ displayMode: 'redirect',
383
+ oauthServer: 'http://mockOauthServer'
384
+ }
385
+ }
386
+ BrowserAuthenticationInitiator constructor {
387
+ clientId: 'mockClientId',
388
+ redirectUrl: 'http://localhost/redirect',
389
+ state: 'eyJ1dWlkIjoiM2FjNmM0MDgtMTAxNS00ZGQ1LTk4ZjAtOTAxMmY2OGIxNTg5IiwiZGlzcGxheU1vZGUiOiJyZWRpcmVjdCJ9',
390
+ scopes: [ 'openid', 'profile' ],
391
+ displayMode: 'redirect',
392
+ oauthServer: 'http://mockOauthServer',
393
+ pkceConsumer: BrowserPublicClientPKCEProducer {
394
+ constructor: [Function: BrowserPublicClientPKCEProducer] {
395
+ getMockName: [Function (anonymous)],
396
+ mockName: [Function (anonymous)],
397
+ mockClear: [Function (anonymous)],
398
+ mockReset: [Function (anonymous)],
399
+ mockRestore: [Function (anonymous)],
400
+ getMockImplementation: [Function (anonymous)],
401
+ mockImplementation: [Function (anonymous)],
402
+ mockImplementationOnce: [Function (anonymous)],
403
+ withImplementation: [Function: withImplementation],
404
+ mockReturnThis: [Function (anonymous)],
405
+ mockReturnValue: [Function (anonymous)],
406
+ mockReturnValueOnce: [Function (anonymous)],
407
+ mockResolvedValue: [Function (anonymous)],
408
+ mockResolvedValueOnce: [Function (anonymous)],
409
+ mockRejectedValue: [Function (anonymous)],
410
+ mockRejectedValueOnce: [Function (anonymous)]
411
+ },
412
+ getCodeChallenge: [Function: getCodeChallenge] {
413
+ getMockName: [Function (anonymous)],
414
+ mockName: [Function (anonymous)],
415
+ mockClear: [Function (anonymous)],
416
+ mockReset: [Function (anonymous)],
417
+ mockRestore: [Function (anonymous)],
418
+ getMockImplementation: [Function (anonymous)],
419
+ mockImplementation: [Function (anonymous)],
420
+ mockImplementationOnce: [Function (anonymous)],
421
+ withImplementation: [Function: withImplementation],
422
+ mockReturnThis: [Function (anonymous)],
423
+ mockReturnValue: [Function (anonymous)],
424
+ mockReturnValueOnce: [Function (anonymous)],
425
+ mockResolvedValue: [Function (anonymous)],
426
+ mockResolvedValueOnce: [Function (anonymous)],
427
+ mockRejectedValue: [Function (anonymous)],
428
+ mockRejectedValueOnce: [Function (anonymous)]
429
+ },
430
+ getCodeVerifier: [Function: getCodeVerifier] {
431
+ getMockName: [Function (anonymous)],
432
+ mockName: [Function (anonymous)],
433
+ mockClear: [Function (anonymous)],
434
+ mockReset: [Function (anonymous)],
435
+ mockRestore: [Function (anonymous)],
436
+ getMockImplementation: [Function (anonymous)],
437
+ mockImplementation: [Function (anonymous)],
438
+ mockImplementationOnce: [Function (anonymous)],
439
+ withImplementation: [Function: withImplementation],
440
+ mockReturnThis: [Function (anonymous)],
441
+ mockReturnValue: [Function (anonymous)],
442
+ mockReturnValueOnce: [Function (anonymous)],
443
+ mockResolvedValue: [Function (anonymous)],
444
+ mockResolvedValueOnce: [Function (anonymous)],
445
+ mockRejectedValue: [Function (anonymous)],
446
+ mockRejectedValueOnce: [Function (anonymous)]
447
+ }
448
+ }
449
+ }
450
+
451
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
452
+ · test/unit/server/login.test.ts (6)
453
+ ✓ test/unit/logger.test.ts (11)
454
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
455
+ ✓ test/unit/nextjs/middleware.test.ts (7)
456
+ · test/unit/services/ServerAuthenticationResolver.test.ts (5)
457
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
458
+ ✓ test/unit/lib/oauth.test.ts (6)
459
+ ✓ test/unit/shared/storage.test.ts (3)
460
+ · test/unit/server/session.test.ts (3)
461
+ ✓ test/unit/utils.test.ts (4)
462
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
463
+ · test/unit/server/login.test.ts (6)
464
+ ✓ test/unit/logger.test.ts (11)
465
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
466
+ ✓ test/unit/nextjs/middleware.test.ts (7)
467
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
468
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
469
+ ✓ test/unit/lib/oauth.test.ts (6)
470
+ ✓ test/unit/shared/storage.test.ts (3)
471
+ ✓ test/unit/server/session.test.ts (3)
472
+ ✓ test/unit/utils.test.ts (4)
473
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
474
+ ✓ test/unit/server/login.test.ts (6)
475
+ ✓ test/unit/logger.test.ts (11)
476
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
477
+ ✓ test/unit/nextjs/middleware.test.ts (7)
478
+ · test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
479
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
480
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
481
+ ✓ test/unit/lib/oauth.test.ts (6)
482
+ ✓ test/unit/shared/storage.test.ts (3)
483
+ ✓ test/unit/server/session.test.ts (3)
484
+ ✓ test/unit/utils.test.ts (4)
485
+ [?25l[?25l[?25l[?25l[?25l[?25l[?25lstdout | test/unit/shared/components/CivicAuthIframeContainer.test.tsx > CivicAuthIframeContainer > triggers a fetch request when 'sameDomainCodeExchangeRequired' is in the iframe body
486
+ handleIframeLoad
487
+ sameDomainCodeExchangeRequired, calling callback URL again...
488
+ handleIframeLoad
489
+ sameDomainCodeExchangeRequired, calling callback URL again...
490
+
491
+ stdout | test/unit/shared/components/CivicAuthIframeContainer.test.tsx > CivicAuthIframeContainer > sets auth response URL when no 'sameDomainCodeExchangeRequired' in iframe body
492
+ handleIframeLoad
493
+ handleIframeLoad
494
+
495
+ stdout | test/unit/shared/components/CivicAuthIframeContainer.test.tsx > CivicAuthIframeContainer > does not call onClose if closeOnRedirect is false
496
+ handleIframeLoad
497
+ sameDomainCodeExchangeRequired, calling callback URL again...
498
+ handleIframeLoad
499
+ sameDomainCodeExchangeRequired, calling callback URL again...
500
+
501
+ [?25l ✓ test/unit/nextjs/config.test.ts (10)
502
+ ✓ test/unit/server/login.test.ts (6)
503
+ ✓ test/unit/logger.test.ts (11)
504
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
505
+ ✓ test/unit/nextjs/middleware.test.ts (7)
506
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
507
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
508
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
509
+ ✓ test/unit/lib/oauth.test.ts (6)
510
+ ✓ test/unit/shared/storage.test.ts (3)
511
+ ✓ test/unit/server/session.test.ts (3)
512
+ ✓ test/unit/utils.test.ts (4)
513
+ [?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l[?25l · test/integration/sdk.test.tsx (2)
514
+ ✓ test/unit/nextjs/config.test.ts (10)
515
+ ✓ test/unit/server/login.test.ts (6)
516
+ ✓ test/unit/logger.test.ts (11)
517
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
518
+ ✓ test/unit/nextjs/middleware.test.ts (7)
519
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
520
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
521
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
522
+ ✓ test/unit/lib/oauth.test.ts (6)
523
+ ✓ test/unit/shared/storage.test.ts (3)
524
+ ✓ test/unit/server/session.test.ts (3)
525
+ ✓ test/unit/utils.test.ts (4)
526
+ [?25l[?25l[?25lstdout | test/integration/sdk.test.tsx > OAuth login > should set the correct auth url for login with redirect
527
+ BrowserAuthenticationService constructor {
528
+ config: {
529
+ clientId: 'test-client-id',
530
+ redirectUrl: 'http://localhost:3001/callback',
531
+ oauthServer: 'http://localhost:3001',
532
+ scopes: [
533
+ 'openid',
534
+ 'profile',
535
+ 'email',
536
+ 'forwardedTokens',
537
+ 'offline_access'
538
+ ],
539
+ displayMode: 'iframe'
540
+ }
541
+ }
542
+ BrowserAuthenticationInitiator constructor {
543
+ clientId: 'test-client-id',
544
+ redirectUrl: 'http://localhost:3001/callback',
545
+ oauthServer: 'http://localhost:3001',
546
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
547
+ displayMode: 'iframe',
548
+ state: 'eyJ1dWlkIjoiNzRlZjBlZjMtN2RiZS00NjZlLWIxNzMtZWRhMzBmNDZmZGE3IiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
549
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
550
+ }
551
+ BrowserAuthenticationInitiator constructor {
552
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} },
553
+ clientId: 'test-client-id',
554
+ redirectUrl: 'http://localhost:3001/callback',
555
+ state: 'eyJ1dWlkIjoiMTQ0YWQ3OGQtNDY3Mi00MTY3LWFkMzktZWQ2NDU2MTQwMTBmIiwiZGlzcGxheU1vZGUiOiJyZWRpcmVjdCJ9',
556
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
557
+ displayMode: 'redirect',
558
+ oauthServer: 'http://localhost:3001',
559
+ endpointOverrides: undefined,
560
+ nonce: undefined
561
+ }
562
+ BrowserAuthenticationService constructor {
563
+ config: {
564
+ clientId: 'test-client-id',
565
+ redirectUrl: 'http://localhost:3001/callback',
566
+ oauthServer: 'http://localhost:3001',
567
+ scopes: [
568
+ 'openid',
569
+ 'profile',
570
+ 'email',
571
+ 'forwardedTokens',
572
+ 'offline_access'
573
+ ],
574
+ displayMode: 'redirect'
575
+ }
576
+ }
577
+ BrowserAuthenticationInitiator constructor {
578
+ clientId: 'test-client-id',
579
+ redirectUrl: 'http://localhost:3001/callback',
580
+ oauthServer: 'http://localhost:3001',
581
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
582
+ displayMode: 'redirect',
583
+ state: 'eyJ1dWlkIjoiMmM3ZjlmZjUtNjY2My00YjUxLTgwN2YtMzkxMjlmNWEzMjFlIiwiZGlzcGxheU1vZGUiOiJyZWRpcmVjdCJ9',
584
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
585
+ }
586
+ handleIframeLoad
587
+
588
+ stdout | test/integration/sdk.test.tsx > OAuth login > should set the correct auth url for login with redirect
589
+ Generated OAuth URL http://localhost:3001/oauth/auth?response_type=code&client_id=test-client-id&redirect_uri=http%3A%2F%2Flocalhost%3A3001%2Fcallback&scope=openid+profile+email&state=mock-state&code_challenge=mock-code-challenge&code_challenge_method=S256&code_challenge=qUmdgqlq8kCMG2ogmCQuKxBj7cLhzgSFoPB84-QwZM4&code_challenge_method=S256&prompt=consent
590
+
591
+ [?25l ❯ test/integration/sdk.test.tsx (2)
592
+ ❯ OAuth login (2)
593
+ ⠙ should set the correct auth url for login with redirect
594
+ · should initiate code exchange, validate tokens, and derive user from ID token
595
+ ✓ test/unit/nextjs/config.test.ts (10)
596
+ ✓ test/unit/server/login.test.ts (6)
597
+ ✓ test/unit/logger.test.ts (11)
598
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
599
+ ✓ test/unit/nextjs/middleware.test.ts (7)
600
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
601
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
602
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
603
+ ✓ test/unit/lib/oauth.test.ts (6)
604
+ ✓ test/unit/shared/storage.test.ts (3)
605
+ ✓ test/unit/server/session.test.ts (3)
606
+ ✓ test/unit/utils.test.ts (4)
607
+ [?25l ❯ test/integration/sdk.test.tsx (2)
608
+ ❯ OAuth login (2)
609
+ ⠹ should set the correct auth url for login with redirect
610
+ · should initiate code exchange, validate tokens, and derive user from ID token
611
+ ✓ test/unit/nextjs/config.test.ts (10)
612
+ ✓ test/unit/server/login.test.ts (6)
613
+ ✓ test/unit/logger.test.ts (11)
614
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
615
+ ✓ test/unit/nextjs/middleware.test.ts (7)
616
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
617
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
618
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
619
+ ✓ test/unit/lib/oauth.test.ts (6)
620
+ ✓ test/unit/shared/storage.test.ts (3)
621
+ ✓ test/unit/server/session.test.ts (3)
622
+ ✓ test/unit/utils.test.ts (4)
623
+ stdout | test/integration/sdk.test.tsx > OAuth login > should initiate code exchange, validate tokens, and derive user from ID token
624
+ BrowserAuthenticationService constructor {
625
+ config: {
626
+ clientId: 'test-client-id',
627
+ redirectUrl: 'http://localhost:3001/callback',
628
+ oauthServer: 'http://localhost:3001',
629
+ scopes: [
630
+ 'openid',
631
+ 'profile',
632
+ 'email',
633
+ 'forwardedTokens',
634
+ 'offline_access'
635
+ ],
636
+ displayMode: 'iframe'
637
+ }
638
+ }
639
+ BrowserAuthenticationInitiator constructor {
640
+ clientId: 'test-client-id',
641
+ redirectUrl: 'http://localhost:3001/callback',
642
+ oauthServer: 'http://localhost:3001',
643
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
644
+ displayMode: 'iframe',
645
+ state: 'eyJ1dWlkIjoiNDg1MTIyZDgtNThlOC00N2FlLTg5YjUtYjMxODdkMWM4ODgyIiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
646
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
647
+ }
648
+ handleIframeLoad
649
+
650
+ stderr | test/integration/sdk.test.tsx > OAuth login > should initiate code exchange, validate tokens, and derive user from ID token
651
+ Failed to parse displayMode from state: mock-state DOMException [InvalidCharacterError]: Invalid character
652
+  at atob (node:buffer:1294:13)
653
+ at Module.displayModeFromState (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/lib/oauth.ts:59:24)
654
+ at BrowserAuthenticationService.tokenExchange (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/services/AuthenticationService.ts:266:31)
655
+ at queryFn (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:185:11)
656
+ window.history.replaceState failed DOMException {}
657
+
658
+ [?25l ❯ test/integration/sdk.test.tsx (2)
659
+ ❯ OAuth login (2)
660
+ ✓ should set the correct auth url for login with redirect
661
+ ⠙ should initiate code exchange, validate tokens, and derive user from ID token
662
+ ✓ test/unit/nextjs/config.test.ts (10)
663
+ ✓ test/unit/server/login.test.ts (6)
664
+ ✓ test/unit/logger.test.ts (11)
665
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
666
+ ✓ test/unit/nextjs/middleware.test.ts (7)
667
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
668
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
669
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
670
+ ✓ test/unit/lib/oauth.test.ts (6)
671
+ ✓ test/unit/shared/storage.test.ts (3)
672
+ ✓ test/unit/server/session.test.ts (3)
673
+ ✓ test/unit/utils.test.ts (4)
674
+ [?25l ❯ test/integration/sdk.test.tsx (2)
675
+ ❯ OAuth login (2)
676
+ ✓ should set the correct auth url for login with redirect
677
+ ⠹ should initiate code exchange, validate tokens, and derive user from ID token
678
+ ✓ test/unit/nextjs/config.test.ts (10)
679
+ ✓ test/unit/server/login.test.ts (6)
680
+ ✓ test/unit/logger.test.ts (11)
681
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
682
+ ✓ test/unit/nextjs/middleware.test.ts (7)
683
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
684
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
685
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
686
+ ✓ test/unit/lib/oauth.test.ts (6)
687
+ ✓ test/unit/shared/storage.test.ts (3)
688
+ ✓ test/unit/server/session.test.ts (3)
689
+ ✓ test/unit/utils.test.ts (4)
690
+ [?25l ❯ test/integration/sdk.test.tsx (2)
691
+ ❯ OAuth login (2)
692
+ ✓ should set the correct auth url for login with redirect
693
+ ⠸ should initiate code exchange, validate tokens, and derive user from ID token
694
+ ✓ test/unit/nextjs/config.test.ts (10)
695
+ ✓ test/unit/server/login.test.ts (6)
696
+ ✓ test/unit/logger.test.ts (11)
697
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
698
+ ✓ test/unit/nextjs/middleware.test.ts (7)
699
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
700
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
701
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
702
+ ✓ test/unit/lib/oauth.test.ts (6)
703
+ ✓ test/unit/shared/storage.test.ts (3)
704
+ ✓ test/unit/server/session.test.ts (3)
705
+ ✓ test/unit/utils.test.ts (4)
706
+ [?25l ❯ test/integration/sdk.test.tsx (2)
707
+ ❯ OAuth login (2)
708
+ ✓ should set the correct auth url for login with redirect
709
+ ⠼ should initiate code exchange, validate tokens, and derive user from ID token
710
+ ✓ test/unit/nextjs/config.test.ts (10)
711
+ ✓ test/unit/server/login.test.ts (6)
712
+ ✓ test/unit/logger.test.ts (11)
713
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
714
+ ✓ test/unit/nextjs/middleware.test.ts (7)
715
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
716
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
717
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
718
+ ✓ test/unit/lib/oauth.test.ts (6)
719
+ ✓ test/unit/shared/storage.test.ts (3)
720
+ ✓ test/unit/server/session.test.ts (3)
721
+ ✓ test/unit/utils.test.ts (4)
722
+ [?25l ❯ test/integration/sdk.test.tsx (2)
723
+ ❯ OAuth login (2)
724
+ ✓ should set the correct auth url for login with redirect
725
+ ⠴ should initiate code exchange, validate tokens, and derive user from ID token
726
+ ✓ test/unit/nextjs/config.test.ts (10)
727
+ ✓ test/unit/server/login.test.ts (6)
728
+ ✓ test/unit/logger.test.ts (11)
729
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
730
+ ✓ test/unit/nextjs/middleware.test.ts (7)
731
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
732
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
733
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
734
+ ✓ test/unit/lib/oauth.test.ts (6)
735
+ ✓ test/unit/shared/storage.test.ts (3)
736
+ ✓ test/unit/server/session.test.ts (3)
737
+ ✓ test/unit/utils.test.ts (4)
738
+ [?25l ✓ test/integration/sdk.test.tsx (2)
739
+ ✓ test/unit/nextjs/config.test.ts (10)
740
+ ✓ test/unit/server/login.test.ts (6)
741
+ ✓ test/unit/logger.test.ts (11)
742
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
743
+ ✓ test/unit/nextjs/middleware.test.ts (7)
744
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
745
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
746
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
747
+ ✓ test/unit/lib/oauth.test.ts (6)
748
+ ✓ test/unit/shared/storage.test.ts (3)
749
+ ✓ test/unit/server/session.test.ts (3)
750
+ ✓ test/unit/utils.test.ts (4)
751
+ [?25l[?25lstdout | test/unit/nextjs/getUser.test.ts
752
+ process.env.NODE_ENV: development
753
+ defaultServerSecure: false
754
+
755
+ [?25l ✓ test/integration/sdk.test.tsx (2)
756
+ ✓ test/unit/nextjs/config.test.ts (10)
757
+ ✓ test/unit/server/login.test.ts (6)
758
+ ✓ test/unit/logger.test.ts (11)
759
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
760
+ ✓ test/unit/nextjs/middleware.test.ts (7)
761
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
762
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
763
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
764
+ ✓ test/unit/lib/oauth.test.ts (6)
765
+ ✓ test/unit/shared/storage.test.ts (3)
766
+ ✓ test/unit/server/session.test.ts (3)
767
+ ✓ test/unit/utils.test.ts (4)
768
+ [?25l ✓ test/integration/sdk.test.tsx (2)
769
+ ✓ test/unit/nextjs/config.test.ts (10)
770
+ ✓ test/unit/server/login.test.ts (6)
771
+ ✓ test/unit/logger.test.ts (11)
772
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
773
+ ✓ test/unit/nextjs/middleware.test.ts (7)
774
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
775
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
776
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
777
+ ✓ test/unit/lib/oauth.test.ts (6)
778
+ ✓ test/unit/shared/storage.test.ts (3)
779
+ ✓ test/unit/server/session.test.ts (3)
780
+ ✓ test/unit/utils.test.ts (4)
781
+ · test/unit/shared/UserSession.test.ts (2)
782
+ [?25l ✓ test/integration/sdk.test.tsx (2)
783
+ ✓ test/unit/nextjs/config.test.ts (10)
784
+ ✓ test/unit/server/login.test.ts (6)
785
+ ✓ test/unit/logger.test.ts (11)
786
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
787
+ ✓ test/unit/nextjs/middleware.test.ts (7)
788
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
789
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
790
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
791
+ ✓ test/unit/lib/oauth.test.ts (6)
792
+ ✓ test/unit/shared/storage.test.ts (3)
793
+ ✓ test/unit/server/session.test.ts (3)
794
+ ✓ test/unit/utils.test.ts (4)
795
+ ✓ test/unit/shared/UserSession.test.ts (2)
796
+ [?25l[?25l[?25l ✓ test/integration/sdk.test.tsx (2)
797
+ ✓ test/unit/nextjs/config.test.ts (10)
798
+ ✓ test/unit/server/login.test.ts (6)
799
+ ✓ test/unit/logger.test.ts (11)
800
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
801
+ ✓ test/unit/nextjs/middleware.test.ts (7)
802
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
803
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
804
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
805
+ ✓ test/unit/lib/oauth.test.ts (6)
806
+ ✓ test/unit/shared/storage.test.ts (3)
807
+ ✓ test/unit/server/session.test.ts (3)
808
+ ✓ test/unit/utils.test.ts (4)
809
+ ✓ test/unit/shared/UserSession.test.ts (2)
810
+ · test/unit/nextjs/utils.test.ts (1)
811
+ [?25l ✓ test/integration/sdk.test.tsx (2)
812
+ ✓ test/unit/nextjs/config.test.ts (10)
813
+ ✓ test/unit/server/login.test.ts (6)
814
+ ✓ test/unit/logger.test.ts (11)
815
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
816
+ ✓ test/unit/nextjs/middleware.test.ts (7)
817
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
818
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
819
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
820
+ ✓ test/unit/lib/oauth.test.ts (6)
821
+ ✓ test/unit/shared/storage.test.ts (3)
822
+ ✓ test/unit/server/session.test.ts (3)
823
+ ✓ test/unit/utils.test.ts (4)
824
+ ✓ test/unit/shared/UserSession.test.ts (2)
825
+ ✓ test/unit/nextjs/utils.test.ts (1)
826
+ [?25l[?25l ✓ test/integration/sdk.test.tsx (2)
827
+ ✓ test/unit/nextjs/config.test.ts (10)
828
+ ✓ test/unit/server/login.test.ts (6)
829
+ ✓ test/unit/logger.test.ts (11)
830
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
831
+ ✓ test/unit/nextjs/middleware.test.ts (7)
832
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
833
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
834
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
835
+ ✓ test/unit/lib/oauth.test.ts (6)
836
+ ✓ test/unit/shared/storage.test.ts (3)
837
+ ✓ test/unit/server/session.test.ts (3)
838
+ ✓ test/unit/utils.test.ts (4)
839
+ · test/unit/react/components/SignInButton.test.tsx (2)
840
+ ✓ test/unit/shared/UserSession.test.ts (2)
841
+ ✓ test/unit/nextjs/utils.test.ts (1)
842
+ [?25l[?25l ✓ test/integration/sdk.test.tsx (2)
843
+ ✓ test/unit/nextjs/config.test.ts (10)
844
+ ✓ test/unit/server/login.test.ts (6)
845
+ ✓ test/unit/logger.test.ts (11)
846
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
847
+ ✓ test/unit/nextjs/middleware.test.ts (7)
848
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
849
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
850
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
851
+ ✓ test/unit/lib/oauth.test.ts (6)
852
+ ✓ test/unit/shared/storage.test.ts (3)
853
+ ✓ test/unit/server/session.test.ts (3)
854
+ ✓ test/unit/utils.test.ts (4)
855
+ · test/unit/react/components/SignInButton.test.tsx (2)
856
+ · test/unit/react/components/SignOutButton.test.tsx (2)
857
+ ✓ test/unit/shared/UserSession.test.ts (2)
858
+ ✓ test/unit/nextjs/utils.test.ts (1)
859
+ [?25l ✓ test/integration/sdk.test.tsx (2)
860
+ ✓ test/unit/nextjs/config.test.ts (10)
861
+ ✓ test/unit/server/login.test.ts (6)
862
+ ✓ test/unit/logger.test.ts (11)
863
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
864
+ ✓ test/unit/nextjs/middleware.test.ts (7)
865
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
866
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
867
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
868
+ ✓ test/unit/lib/oauth.test.ts (6)
869
+ ✓ test/unit/shared/storage.test.ts (3)
870
+ ✓ test/unit/server/session.test.ts (3)
871
+ ✓ test/unit/utils.test.ts (4)
872
+ · test/unit/react/components/SignInButton.test.tsx (2)
873
+ · test/unit/react/components/SignOutButton.test.tsx (2)
874
+ · test/unit/nextjs/getUser.test.ts (1)
875
+ ✓ test/unit/shared/UserSession.test.ts (2)
876
+ ✓ test/unit/nextjs/utils.test.ts (1)
877
+ [?25l ✓ test/integration/sdk.test.tsx (2)
878
+ ✓ test/unit/nextjs/config.test.ts (10)
879
+ ✓ test/unit/server/login.test.ts (6)
880
+ ✓ test/unit/logger.test.ts (11)
881
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
882
+ ✓ test/unit/nextjs/middleware.test.ts (7)
883
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
884
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
885
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
886
+ ✓ test/unit/lib/oauth.test.ts (6)
887
+ ✓ test/unit/shared/storage.test.ts (3)
888
+ ✓ test/unit/server/session.test.ts (3)
889
+ ✓ test/unit/utils.test.ts (4)
890
+ · test/unit/react/components/SignInButton.test.tsx (2)
891
+ · test/unit/react/components/SignOutButton.test.tsx (2)
892
+ · test/unit/nextjs/getUser.test.ts (1)
893
+ ✓ test/unit/shared/UserSession.test.ts (2)
894
+ · test/unit/nextjs/NextAuthProvider.test.tsx (1)
895
+ ✓ test/unit/nextjs/utils.test.ts (1)
896
+ · test/unit/publicApi/apiSnapshot.test.ts (1)
897
+ [?25l ✓ test/integration/sdk.test.tsx (2)
898
+ ✓ test/unit/nextjs/config.test.ts (10)
899
+ ✓ test/unit/server/login.test.ts (6)
900
+ ✓ test/unit/logger.test.ts (11)
901
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
902
+ ✓ test/unit/nextjs/middleware.test.ts (7)
903
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
904
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
905
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
906
+ ✓ test/unit/lib/oauth.test.ts (6)
907
+ ✓ test/unit/shared/storage.test.ts (3)
908
+ ✓ test/unit/server/session.test.ts (3)
909
+ ✓ test/unit/utils.test.ts (4)
910
+ · test/unit/react/components/SignInButton.test.tsx (2)
911
+ · test/unit/react/components/SignOutButton.test.tsx (2)
912
+ ✓ test/unit/nextjs/getUser.test.ts (1)
913
+ ✓ test/unit/shared/UserSession.test.ts (2)
914
+ · test/unit/nextjs/NextAuthProvider.test.tsx (1)
915
+ ✓ test/unit/nextjs/utils.test.ts (1)
916
+ · test/unit/publicApi/apiSnapshot.test.ts (1)
917
+ stdout | test/unit/react/components/SignInButton.test.tsx > SignInButton Component > should render a SignInButton component
918
+ BrowserAuthenticationService constructor {
919
+ config: {
920
+ clientId: 'test-client-id',
921
+ redirectUrl: 'https://example.com',
922
+ oauthServer: 'https://auth.civic.com/oauth',
923
+ scopes: [
924
+ 'openid',
925
+ 'profile',
926
+ 'email',
927
+ 'forwardedTokens',
928
+ 'offline_access'
929
+ ],
930
+ displayMode: 'iframe'
931
+ }
932
+ }
933
+ BrowserAuthenticationInitiator constructor {
934
+ clientId: 'test-client-id',
935
+ redirectUrl: 'https://example.com',
936
+ oauthServer: 'https://auth.civic.com/oauth',
937
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
938
+ displayMode: 'iframe',
939
+ state: 'eyJ1dWlkIjoiYzY0MjhjZWItY2NjYi00ZWFjLTg1NTAtNmE5NjFmNDU1OWI1IiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
940
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
941
+ }
942
+ handleIframeLoad
943
+
944
+ stderr | test/unit/react/components/SignInButton.test.tsx > SignInButton Component > should render a SignInButton component
945
+ Warning: An update to CivicAuthIframeContainer inside a test was not wrapped in act(...).
946
+
947
+ When testing, code that causes React state updates should be wrapped into act(...):
948
+
949
+ act(() => {
950
+ /* fire events that update state */
951
+ });
952
+ /* assert on the output */
953
+
954
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
955
+ at CivicAuthIframeContainer (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/components/CivicAuthIframeContainer.tsx:79:3)
956
+ at div
957
+ at TokenProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/TokenProvider.tsx:15:26)
958
+ at SessionProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/SessionProvider.tsx:11:28)
959
+ at IframeProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/IframeProvider.tsx:11:3)
960
+ at ConfigProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/ConfigProvider.tsx:14:3)
961
+ at AuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:83:3)
962
+ at QueryClientProvider (file:///Users/flippie/civic/repos/civic-auth/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js:20:3)
963
+ at CivicAuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/CivicAuthProvider.tsx:15:30)
964
+
965
+ stdout | test/unit/react/components/SignInButton.test.tsx > SignInButton Component > should call signIn when the button is clicked
966
+ BrowserAuthenticationService constructor {
967
+ config: {
968
+ clientId: 'test-client-id',
969
+ redirectUrl: 'https://example.com',
970
+ oauthServer: 'https://auth.civic.com/oauth',
971
+ scopes: [
972
+ 'openid',
973
+ 'profile',
974
+ 'email',
975
+ 'forwardedTokens',
976
+ 'offline_access'
977
+ ],
978
+ displayMode: 'iframe'
979
+ }
980
+ }
981
+ BrowserAuthenticationInitiator constructor {
982
+ clientId: 'test-client-id',
983
+ redirectUrl: 'https://example.com',
984
+ oauthServer: 'https://auth.civic.com/oauth',
985
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
986
+ displayMode: 'iframe',
987
+ state: 'eyJ1dWlkIjoiODNlOTcxMWItZWIwNi00OGE0LWI2OTctMDJjNWQ5MjE0NDJlIiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
988
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
989
+ }
990
+ handleIframeLoad
991
+
992
+ stderr | test/unit/react/components/SignInButton.test.tsx > SignInButton Component > should call signIn when the button is clicked
993
+ Warning: An update to CivicAuthIframeContainer inside a test was not wrapped in act(...).
994
+
995
+ When testing, code that causes React state updates should be wrapped into act(...):
996
+
997
+ act(() => {
998
+ /* fire events that update state */
999
+ });
1000
+ /* assert on the output */
1001
+
1002
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
1003
+ at CivicAuthIframeContainer (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/components/CivicAuthIframeContainer.tsx:79:3)
1004
+ at div
1005
+ at TokenProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/TokenProvider.tsx:15:26)
1006
+ at SessionProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/SessionProvider.tsx:11:28)
1007
+ at IframeProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/IframeProvider.tsx:11:3)
1008
+ at ConfigProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/ConfigProvider.tsx:14:3)
1009
+ at AuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:83:3)
1010
+ at QueryClientProvider (file:///Users/flippie/civic/repos/civic-auth/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js:20:3)
1011
+ at CivicAuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/CivicAuthProvider.tsx:15:30)
1012
+
1013
+ stdout | test/unit/react/components/SignOutButton.test.tsx > SignOutButton Component > should render a SignOutButton component
1014
+ BrowserAuthenticationService constructor {
1015
+ config: {
1016
+ clientId: 'test-client-id',
1017
+ redirectUrl: 'https://example.com',
1018
+ oauthServer: 'https://auth.civic.com/oauth',
1019
+ scopes: [
1020
+ 'openid',
1021
+ 'profile',
1022
+ 'email',
1023
+ 'forwardedTokens',
1024
+ 'offline_access'
1025
+ ],
1026
+ displayMode: 'iframe'
1027
+ }
1028
+ }
1029
+ BrowserAuthenticationInitiator constructor {
1030
+ clientId: 'test-client-id',
1031
+ redirectUrl: 'https://example.com',
1032
+ oauthServer: 'https://auth.civic.com/oauth',
1033
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
1034
+ displayMode: 'iframe',
1035
+ state: 'eyJ1dWlkIjoiZWY3ZDIwYzEtNWUwOS00NDVkLWJkMDAtNjkzYTA5MTQwZWJlIiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
1036
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
1037
+ }
1038
+ handleIframeLoad
1039
+
1040
+ stderr | test/unit/react/components/SignOutButton.test.tsx > SignOutButton Component > should render a SignOutButton component
1041
+ Warning: An update to CivicAuthIframeContainer inside a test was not wrapped in act(...).
1042
+
1043
+ When testing, code that causes React state updates should be wrapped into act(...):
1044
+
1045
+ act(() => {
1046
+ /* fire events that update state */
1047
+ });
1048
+ /* assert on the output */
1049
+
1050
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
1051
+ at CivicAuthIframeContainer (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/components/CivicAuthIframeContainer.tsx:79:3)
1052
+ at div
1053
+ at TokenProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/TokenProvider.tsx:15:26)
1054
+ at SessionProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/SessionProvider.tsx:11:28)
1055
+ at IframeProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/IframeProvider.tsx:11:3)
1056
+ at ConfigProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/ConfigProvider.tsx:14:3)
1057
+ at AuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:83:3)
1058
+ at QueryClientProvider (file:///Users/flippie/civic/repos/civic-auth/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js:20:3)
1059
+ at CivicAuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/CivicAuthProvider.tsx:15:30)
1060
+
1061
+ stdout | test/unit/react/components/SignOutButton.test.tsx > SignOutButton Component > should call signIn when the button is clicked
1062
+ BrowserAuthenticationService constructor {
1063
+ config: {
1064
+ clientId: 'test-client-id',
1065
+ redirectUrl: 'https://example.com',
1066
+ oauthServer: 'https://auth.civic.com/oauth',
1067
+ scopes: [
1068
+ 'openid',
1069
+ 'profile',
1070
+ 'email',
1071
+ 'forwardedTokens',
1072
+ 'offline_access'
1073
+ ],
1074
+ displayMode: 'iframe'
1075
+ }
1076
+ }
1077
+ BrowserAuthenticationInitiator constructor {
1078
+ clientId: 'test-client-id',
1079
+ redirectUrl: 'https://example.com',
1080
+ oauthServer: 'https://auth.civic.com/oauth',
1081
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
1082
+ displayMode: 'iframe',
1083
+ state: 'eyJ1dWlkIjoiM2NlYjUwZWItN2RlOS00ZDhkLWJkYzMtY2I4YzkyOGQ1NzY4IiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
1084
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
1085
+ }
1086
+ handleIframeLoad
1087
+
1088
+ stderr | test/unit/react/components/SignOutButton.test.tsx > SignOutButton Component > should call signIn when the button is clicked
1089
+ Warning: An update to CivicAuthIframeContainer inside a test was not wrapped in act(...).
1090
+
1091
+ When testing, code that causes React state updates should be wrapped into act(...):
1092
+
1093
+ act(() => {
1094
+ /* fire events that update state */
1095
+ });
1096
+ /* assert on the output */
1097
+
1098
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
1099
+ at CivicAuthIframeContainer (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/components/CivicAuthIframeContainer.tsx:79:3)
1100
+ at div
1101
+ at TokenProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/TokenProvider.tsx:15:26)
1102
+ at SessionProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/SessionProvider.tsx:11:28)
1103
+ at IframeProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/IframeProvider.tsx:11:3)
1104
+ at ConfigProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/ConfigProvider.tsx:14:3)
1105
+ at AuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:83:3)
1106
+ at QueryClientProvider (file:///Users/flippie/civic/repos/civic-auth/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js:20:3)
1107
+ at CivicAuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/CivicAuthProvider.tsx:15:30)
1108
+
1109
+ [?25l ✓ test/integration/sdk.test.tsx (2)
1110
+ ✓ test/unit/nextjs/config.test.ts (10)
1111
+ ✓ test/unit/server/login.test.ts (6)
1112
+ ✓ test/unit/logger.test.ts (11)
1113
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
1114
+ ✓ test/unit/nextjs/middleware.test.ts (7)
1115
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
1116
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
1117
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
1118
+ ✓ test/unit/lib/oauth.test.ts (6)
1119
+ ✓ test/unit/shared/storage.test.ts (3)
1120
+ ✓ test/unit/server/session.test.ts (3)
1121
+ ✓ test/unit/utils.test.ts (4)
1122
+ · test/unit/react/components/SignInButton.test.tsx (2)
1123
+ · test/unit/react/components/SignOutButton.test.tsx (2)
1124
+ ✓ test/unit/nextjs/getUser.test.ts (1)
1125
+ ✓ test/unit/shared/UserSession.test.ts (2)
1126
+ · test/unit/nextjs/NextAuthProvider.test.tsx (1)
1127
+ ✓ test/unit/nextjs/utils.test.ts (1)
1128
+ ✓ test/unit/publicApi/apiSnapshot.test.ts (1)
1129
+ [?25lstdout | test/unit/nextjs/NextAuthProvider.test.tsx > CivicNextAuthProvider > should call resolveAuthConfig with no arguments
1130
+ BrowserAuthenticationService constructor {
1131
+ config: {
1132
+ clientId: 'test-client-id',
1133
+ redirectUrl: 'https://example.com/callback',
1134
+ oauthServer: 'https://example.com',
1135
+ scopes: [
1136
+ 'openid',
1137
+ 'profile',
1138
+ 'email',
1139
+ 'forwardedTokens',
1140
+ 'offline_access'
1141
+ ],
1142
+ displayMode: 'iframe'
1143
+ }
1144
+ }
1145
+ BrowserAuthenticationInitiator constructor {
1146
+ clientId: 'test-client-id',
1147
+ redirectUrl: 'https://example.com/callback',
1148
+ oauthServer: 'https://example.com',
1149
+ scopes: [ 'openid', 'profile', 'email', 'forwardedTokens', 'offline_access' ],
1150
+ displayMode: 'iframe',
1151
+ state: 'eyJ1dWlkIjoiZTg3OWE5NmEtOWVhOS00MDhmLWIyMDMtNzMwMDdhZGJkNmU4IiwiZGlzcGxheU1vZGUiOiJpZnJhbWUifQ==',
1152
+ pkceConsumer: BrowserPublicClientPKCEProducer { storage: LocalStorageAdapter {} }
1153
+ }
1154
+ handleIframeLoad
1155
+
1156
+ stderr | test/unit/nextjs/NextAuthProvider.test.tsx > CivicNextAuthProvider > should call resolveAuthConfig with no arguments
1157
+ Warning: An update to CivicAuthIframeContainer inside a test was not wrapped in act(...).
1158
+
1159
+ When testing, code that causes React state updates should be wrapped into act(...):
1160
+
1161
+ act(() => {
1162
+ /* fire events that update state */
1163
+ });
1164
+ /* assert on the output */
1165
+
1166
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://reactjs.org/link/wrap-tests-with-act
1167
+ at CivicAuthIframeContainer (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/components/CivicAuthIframeContainer.tsx:79:3)
1168
+ at div
1169
+ at TokenProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/TokenProvider.tsx:15:26)
1170
+ at SessionProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/SessionProvider.tsx:11:28)
1171
+ at IframeProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/IframeProvider.tsx:11:3)
1172
+ at ConfigProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/ConfigProvider.tsx:14:3)
1173
+ at AuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/shared/providers/AuthProvider.tsx:83:3)
1174
+ at CivicNextAuthProviderInternal (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/nextjs/providers/NextAuthProvider.tsx:26:3)
1175
+ at QueryClientProvider (file:///Users/flippie/civic/repos/civic-auth/node_modules/@tanstack/react-query/build/modern/QueryClientProvider.js:20:3)
1176
+ at CivicNextAuthProvider (/Users/flippie/civic/repos/civic-auth/packages/civic-auth-client/src/nextjs/providers/NextAuthProvider.tsx:75:3)
1177
+
1178
+ [?25l ✓ test/integration/sdk.test.tsx (2)
1179
+ ✓ test/unit/nextjs/config.test.ts (10)
1180
+ ✓ test/unit/server/login.test.ts (6)
1181
+ ✓ test/unit/logger.test.ts (11)
1182
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
1183
+ ✓ test/unit/nextjs/middleware.test.ts (7)
1184
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
1185
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
1186
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
1187
+ ✓ test/unit/lib/oauth.test.ts (6)
1188
+ ✓ test/unit/shared/storage.test.ts (3)
1189
+ ✓ test/unit/server/session.test.ts (3)
1190
+ ✓ test/unit/utils.test.ts (4)
1191
+ ✓ test/unit/react/components/SignInButton.test.tsx (2)
1192
+ ✓ test/unit/react/components/SignOutButton.test.tsx (2)
1193
+ ✓ test/unit/nextjs/getUser.test.ts (1)
1194
+ ✓ test/unit/shared/UserSession.test.ts (2)
1195
+ · test/unit/nextjs/NextAuthProvider.test.tsx (1)
1196
+ ✓ test/unit/nextjs/utils.test.ts (1)
1197
+ ✓ test/unit/publicApi/apiSnapshot.test.ts (1)
1198
+ [?25l[?25l ✓ test/integration/sdk.test.tsx (2)
1199
+ ✓ test/unit/nextjs/config.test.ts (10)
1200
+ ✓ test/unit/server/login.test.ts (6)
1201
+ ✓ test/unit/logger.test.ts (11)
1202
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
1203
+ ✓ test/unit/nextjs/middleware.test.ts (7)
1204
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
1205
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
1206
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
1207
+ ✓ test/unit/lib/oauth.test.ts (6)
1208
+ ✓ test/unit/shared/storage.test.ts (3)
1209
+ ✓ test/unit/server/session.test.ts (3)
1210
+ ✓ test/unit/utils.test.ts (4)
1211
+ ✓ test/unit/react/components/SignInButton.test.tsx (2)
1212
+ ✓ test/unit/react/components/SignOutButton.test.tsx (2)
1213
+ ✓ test/unit/nextjs/getUser.test.ts (1)
1214
+ ✓ test/unit/shared/UserSession.test.ts (2)
1215
+ ✓ test/unit/nextjs/NextAuthProvider.test.tsx (1)
1216
+ ✓ test/unit/nextjs/utils.test.ts (1)
1217
+ ✓ test/unit/publicApi/apiSnapshot.test.ts (1)
1218
+ [?25l[?25l[?25l ✓ test/integration/sdk.test.tsx (2)
1219
+ ✓ test/unit/logger.test.ts (11)
1220
+ ✓ test/unit/utils.test.ts (4)
1221
+ ✓ test/unit/lib/oauth.test.ts (6)
1222
+ ✓ test/unit/publicApi/apiSnapshot.test.ts (1)
1223
+ ✓ test/unit/server/login.test.ts (6)
1224
+ ✓ test/unit/server/session.test.ts (3)
1225
+ ✓ test/unit/services/AuthenticationService.test.ts (6)
1226
+ ✓ test/unit/services/ServerAuthenticationResolver.test.ts (5)
1227
+ ✓ test/unit/shared/GenericAuthenticationRefresher.test.ts (3)
1228
+ ✓ test/unit/shared/UserSession.test.ts (2)
1229
+ ✓ test/unit/shared/storage.test.ts (3)
1230
+ ✓ test/unit/nextjs/NextAuthProvider.test.tsx (1)
1231
+ ✓ test/unit/nextjs/config.test.ts (10)
1232
+ ✓ test/unit/nextjs/getUser.test.ts (1)
1233
+ ✓ test/unit/nextjs/middleware.test.ts (7)
1234
+ ✓ test/unit/nextjs/utils.test.ts (1)
1235
+ ✓ test/unit/shared/components/CivicAuthIframeContainer.test.tsx (3)
1236
+ ✓ test/unit/react/components/SignInButton.test.tsx (2)
1237
+ ✓ test/unit/react/components/SignOutButton.test.tsx (2)
1238
+
1239
+  Test Files  20 passed (20)
1240
+  Tests  79 passed (79)
1241
+  Start at  16:36:04
1242
+  Duration  2.66s (transform 766ms, setup 0ms, collect 4.33s, tests 557ms, environment 14.37s, prepare 2.13s)
1243
+
1244
+  % Coverage report from v8
1245
+ --------------------------------------|---------|----------|---------|---------|-------------------
1246
+ File | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s
1247
+ --------------------------------------|---------|----------|---------|---------|-------------------
1248
+ All files  |  80.49 |  85.94 |  70.76 |  80.49 |  
1249
+  src  |  100 |  100 |  100 |  100 |  
1250
+  config.ts  |  100 |  100 |  100 |  100 |  
1251
+  constants.ts  |  100 |  100 |  100 |  100 |  
1252
+ index.ts | 0 | 0 | 0 | 0 |  
1253
+ types.ts | 0 | 0 | 0 | 0 |  
1254
+  utils.ts  |  100 |  100 |  100 |  100 |  
1255
+  src/browser  |  100 |  100 |  100 |  100 |  
1256
+  storage.ts  |  100 |  100 |  100 |  100 |  
1257
+  src/lib  |  70.87 |  81.48 |  83.33 |  70.87 |  
1258
+  cookies.ts  |  4.16 |  100 |  0 |  4.16 | 2-27 
1259
+  jwt.ts  |  100 |  100 |  100 |  100 |  
1260
+  logger.ts  |  100 |  100 |  100 |  100 |  
1261
+  oauth.ts  |  83.63 |  81.81 |  83.33 |  83.63 | 6,68-75 
1262
+  postMessage.ts  |  5.55 |  100 |  0 |  5.55 | 4-20 
1263
+  windowUtil.ts  |  82.6 |  57.14 |  100 |  82.6 | 6-7,11-12 
1264
+  src/nextjs  |  47.17 |  86.04 |  40.74 |  47.17 |  
1265
+  GetUser.ts  |  100 |  33.33 |  100 |  100 | 14-20 
1266
+  config.ts  |  99.2 |  81.25 |  100 |  99.2 | 126 
1267
+  cookies.ts  |  19.09 |  100 |  10 |  19.09 | ...52-153,156-157
1268
+  index.ts  |  100 |  100 |  100 |  100 |  
1269
+  middleware.ts  |  100 |  95.45 |  100 |  100 | 49 
1270
+  routeHandler.ts  |  4.23 |  100 |  0 |  4.23 | ...20-255,271-301
1271
+  utils.ts  |  100 |  100 |  100 |  100 |  
1272
+  src/nextjs/hooks  |  11.29 |  100 |  0 |  11.29 |  
1273
+  index.ts  |  100 |  100 |  100 |  100 |  
1274
+  useTokenCookie.ts  |  9.67 |  100 |  0 |  9.67 | 9-14,17-41 
1275
+  useUserCookie.ts  |  10 |  100 |  0 |  10 | 10-14,17-41 
1276
+  src/nextjs/middleware  |  100 |  100 |  100 |  100 |  
1277
+  index.ts  |  100 |  100 |  100 |  100 |  
1278
+  src/nextjs/providers  |  87.93 |  71.42 |  66.66 |  87.93 |  
1279
+  NextAuthProvider.tsx  |  87.93 |  71.42 |  66.66 |  87.93 | 47-53 
1280
+  src/reactjs  |  100 |  100 |  100 |  100 |  
1281
+  index.ts  |  100 |  100 |  100 |  100 |  
1282
+  src/reactjs/components  |  19.81 |  100 |  57.14 |  19.81 |  
1283
+  SignInButton.tsx  |  100 |  100 |  100 |  100 |  
1284
+  SignOutButton.tsx  |  100 |  100 |  100 |  100 |  
1285
+  UserButton.tsx  |  2.29 |  100 |  0 |  2.29 | 7-20,24-37,41-213
1286
+  index.ts  |  100 |  100 |  100 |  100 |  
1287
+  src/reactjs/hooks  |  44.44 |  33.33 |  50 |  44.44 |  
1288
+  index.ts  |  100 |  100 |  100 |  100 |  
1289
+  useAuth.ts  |  0 |  0 |  0 |  0 | 1-13 
1290
+  useUser.ts  |  77.77 |  50 |  100 |  77.77 | 14-15 
1291
+  src/reactjs/providers  |  100 |  100 |  100 |  100 |  
1292
+  index.ts  |  100 |  100 |  100 |  100 |  
1293
+  src/server  |  86.04 |  73.68 |  76.92 |  86.04 |  
1294
+  ServerAuthenticationResolver.ts  |  97.4 |  88.88 |  85.71 |  97.4 | 36-37 
1295
+ config.ts | 0 | 0 | 0 | 0 |  
1296
+  index.ts  |  0 |  0 |  0 |  0 | 1 
1297
+  login.ts  |  100 |  71.42 |  100 |  100 | 23,52 
1298
+  refresh.ts  |  0 |  0 |  0 |  0 | 1-23 
1299
+  src/services  |  69.81 |  72.72 |  84 |  69.81 |  
1300
+  AuthenticationService.ts  |  69.31 |  67.85 |  88.88 |  69.31 | ...73-274,305-323
1301
+  PKCE.ts  |  77.77 |  100 |  83.33 |  77.77 | 12-17 
1302
+  types.ts  |  50 |  100 |  0 |  50 | 51-53 
1303
+  src/shared/components  |  93.36 |  86.36 |  71.42 |  93.36 |  
1304
+  CivicAuthIframe.tsx  |  100 |  100 |  100 |  100 |  
1305
+  CivicAuthIframeContainer.tsx  |  90.2 |  84.21 |  60 |  90.2 | ...44-147,162-163
1306
+  CloseIcon.tsx  |  100 |  100 |  100 |  100 |  
1307
+  LoadingIcon.tsx  |  100 |  100 |  100 |  100 |  
1308
+  src/shared/hooks  |  75.6 |  50 |  100 |  75.6 |  
1309
+  index.ts  |  100 |  100 |  100 |  100 |  
1310
+  useAuth.ts  |  75 |  50 |  100 |  75 | 9-10 
1311
+  useConfig.ts  |  75 |  50 |  100 |  75 | 9-10 
1312
+  useIframe.ts  |  75 |  50 |  100 |  75 | 9-10 
1313
+  useSession.ts  |  75 |  50 |  100 |  75 | 9-10 
1314
+  useToken.ts  |  75 |  50 |  100 |  75 | 9-10 
1315
+  src/shared/lib  |  92.85 |  86 |  90.9 |  92.85 |  
1316
+  GenericAuthenticationRefresher.ts  |  100 |  85.71 |  100 |  100 | 60 
1317
+  UserSession.ts  |  100 |  87.5 |  100 |  100 | 22 
1318
+  session.ts  |  100 |  100 |  100 |  100 |  
1319
+  storage.ts  |  100 |  100 |  100 |  100 |  
1320
+  types.ts  |  100 |  100 |  100 |  100 |  
1321
+  util.ts  |  88.15 |  75 |  81.81 |  88.15 | ...33-137,162-164
1322
+  src/shared/providers  |  85.36 |  77.01 |  61.11 |  85.36 |  
1323
+  AuthContext.tsx  |  100 |  100 |  100 |  100 |  
1324
+  AuthProvider.tsx  |  80.06 |  72.13 |  50 |  80.06 | ...29-330,375-379
1325
+  CivicAuthProvider.tsx  |  100 |  100 |  100 |  100 |  
1326
+  ConfigProvider.tsx  |  100 |  100 |  100 |  100 |  
1327
+  IframeProvider.tsx  |  100 |  100 |  50 |  100 |  
1328
+  SessionProvider.tsx  |  100 |  100 |  100 |  100 |  
1329
+  TokenProvider.tsx  |  88.88 |  84.61 |  33.33 |  88.88 | 30-31,34-35,49 
1330
+  UserProvider.tsx  |  95.45 |  87.5 |  100 |  95.45 | 42-43 
1331
+  test/integration  |  98.96 |  94.11 |  100 |  98.96 |  
1332
+  sdk.test.tsx  |  98.96 |  94.11 |  100 |  98.96 | 31-32 
1333
+  test/support  |  100 |  100 |  100 |  100 |  
1334
+  fixtures.ts  |  100 |  100 |  100 |  100 |  
1335
+  test/unit  |  100 |  100 |  100 |  100 |  
1336
+  logger.test.ts  |  100 |  100 |  100 |  100 |  
1337
+  utils.test.ts  |  100 |  100 |  100 |  100 |  
1338
+  test/unit/lib  |  100 |  100 |  100 |  100 |  
1339
+  oauth.test.ts  |  100 |  100 |  100 |  100 |  
1340
+  test/unit/nextjs  |  99.7 |  97.67 |  100 |  99.7 |  
1341
+  NextAuthProvider.test.tsx  |  100 |  100 |  100 |  100 |  
1342
+  config.test.ts  |  100 |  100 |  100 |  100 |  
1343
+  getUser.test.ts  |  97.29 |  87.5 |  100 |  97.29 | 31 
1344
+  middleware.test.ts  |  100 |  100 |  100 |  100 |  
1345
+  utils.test.ts  |  100 |  100 |  100 |  100 |  
1346
+  test/unit/publicApi  |  100 |  100 |  100 |  100 |  
1347
+  apiSnapshot.test.ts  |  100 |  100 |  100 |  100 |  
1348
+  test/unit/react/components  |  100 |  100 |  0 |  100 |  
1349
+  SignInButton.test.tsx  |  100 |  100 |  0 |  100 |  
1350
+  SignOutButton.test.tsx  |  100 |  100 |  0 |  100 |  
1351
+  test/unit/server  |  97.7 |  76.19 |  33.33 |  97.7 |  
1352
+  login.test.ts  |  97.12 |  68.75 |  33.33 |  97.12 | 23-24,27-28 
1353
+  session.test.ts  |  100 |  100 |  100 |  100 |  
1354
+  test/unit/services  |  100 |  100 |  100 |  100 |  
1355
+  AuthenticationService.test.ts  |  100 |  100 |  100 |  100 |  
1356
+  ...erAuthenticationResolver.test.ts |  100 |  100 |  100 |  100 |  
1357
+  test/unit/shared  |  100 |  100 |  100 |  100 |  
1358
+  ...cAuthenticationRefresher.test.ts |  100 |  100 |  100 |  100 |  
1359
+  UserSession.test.ts  |  100 |  100 |  100 |  100 |  
1360
+  storage.test.ts  |  100 |  100 |  100 |  100 |  
1361
+  test/unit/shared/components  |  100 |  100 |  100 |  100 |  
1362
+  CivicAuthIframeContainer.test.tsx  |  100 |  100 |  100 |  100 |  
1363
+ --------------------------------------|---------|----------|---------|---------|-------------------
1364
+ [?25h[?25h