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

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