@@ -514,10 +514,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
514
514
// assert session has been updated
515
515
const updatedSessionCookie = response . cookies . get ( "__session" ) ;
516
516
expect ( updatedSessionCookie ) . toBeDefined ( ) ;
517
- const { payload : updatedSessionCookieValue } = await decrypt (
517
+ const { payload : updatedSessionCookieValue } = ( await decrypt (
518
518
updatedSessionCookie ! . value ,
519
519
secret
520
- ) ;
520
+ ) ) as jose . JWTDecryptResult ;
521
521
expect ( updatedSessionCookieValue ) . toEqual (
522
522
expect . objectContaining ( {
523
523
user : {
@@ -954,7 +954,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
954
954
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
955
955
) ;
956
956
expect ( transactionCookie ) . toBeDefined ( ) ;
957
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
957
+ expect (
958
+ (
959
+ ( await decrypt (
960
+ transactionCookie ! . value ,
961
+ secret
962
+ ) ) as jose . JWTDecryptResult
963
+ ) . payload
964
+ ) . toEqual (
958
965
expect . objectContaining ( {
959
966
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
960
967
codeVerifier : expect . any ( String ) ,
@@ -1158,7 +1165,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1158
1165
) ;
1159
1166
expect ( transactionCookie ) . toBeDefined ( ) ;
1160
1167
expect (
1161
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1168
+ (
1169
+ ( await decrypt (
1170
+ transactionCookie ! . value ,
1171
+ secret
1172
+ ) ) as jose . JWTDecryptResult
1173
+ ) . payload
1162
1174
) . toEqual (
1163
1175
expect . objectContaining ( {
1164
1176
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
@@ -1493,7 +1505,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1493
1505
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1494
1506
) ;
1495
1507
expect ( transactionCookie ) . toBeDefined ( ) ;
1496
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1508
+ expect (
1509
+ (
1510
+ ( await decrypt (
1511
+ transactionCookie ! . value ,
1512
+ secret
1513
+ ) ) as jose . JWTDecryptResult
1514
+ ) . payload
1515
+ ) . toEqual (
1497
1516
expect . objectContaining ( {
1498
1517
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1499
1518
maxAge : 3600 ,
@@ -1540,7 +1559,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1540
1559
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1541
1560
) ;
1542
1561
expect ( transactionCookie ) . toBeDefined ( ) ;
1543
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1562
+ expect (
1563
+ (
1564
+ ( await decrypt (
1565
+ transactionCookie ! . value ,
1566
+ secret
1567
+ ) ) as jose . JWTDecryptResult
1568
+ ) . payload
1569
+ ) . toEqual (
1544
1570
expect . objectContaining ( {
1545
1571
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1546
1572
codeVerifier : expect . any ( String ) ,
@@ -1586,7 +1612,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1586
1612
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1587
1613
) ;
1588
1614
expect ( transactionCookie ) . toBeDefined ( ) ;
1589
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1615
+ expect (
1616
+ (
1617
+ ( await decrypt (
1618
+ transactionCookie ! . value ,
1619
+ secret
1620
+ ) ) as jose . JWTDecryptResult
1621
+ ) . payload
1622
+ ) . toEqual (
1590
1623
expect . objectContaining ( {
1591
1624
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1592
1625
codeVerifier : expect . any ( String ) ,
@@ -1720,7 +1753,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1720
1753
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1721
1754
expect ( transactionCookie ) . toBeDefined ( ) ;
1722
1755
expect (
1723
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1756
+ (
1757
+ ( await decrypt (
1758
+ transactionCookie . value ,
1759
+ secret
1760
+ ) ) as jose . JWTDecryptResult
1761
+ ) . payload
1724
1762
) . toEqual (
1725
1763
expect . objectContaining ( {
1726
1764
nonce : expect . any ( String ) ,
@@ -1874,7 +1912,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1874
1912
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1875
1913
expect ( transactionCookie ) . toBeDefined ( ) ;
1876
1914
expect (
1877
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1915
+ (
1916
+ ( await decrypt (
1917
+ transactionCookie . value ,
1918
+ secret
1919
+ ) ) as jose . JWTDecryptResult
1920
+ ) . payload
1878
1921
) . toEqual (
1879
1922
expect . objectContaining ( {
1880
1923
nonce : expect . any ( String ) ,
@@ -1956,7 +1999,7 @@ ca/T0LLtgmbMmxSv/MmzIg==
1956
1999
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1957
2000
expect ( transactionCookie ) . toBeDefined ( ) ;
1958
2001
expect (
1959
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
2002
+ ( await decrypt ( transactionCookie ! . value , secret ) ) ! . payload
1960
2003
) . toEqual (
1961
2004
expect . objectContaining ( {
1962
2005
nonce : expect . any ( String ) ,
@@ -2512,7 +2555,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
2512
2555
// validate the session cookie
2513
2556
const sessionCookie = response . cookies . get ( "__session" ) ;
2514
2557
expect ( sessionCookie ) . toBeDefined ( ) ;
2515
- const { payload : session } = await decrypt ( sessionCookie ! . value , secret ) ;
2558
+ const { payload : session } = ( await decrypt (
2559
+ sessionCookie ! . value ,
2560
+ secret
2561
+ ) ) as jose . JWTDecryptResult ;
2516
2562
expect ( session ) . toEqual (
2517
2563
expect . objectContaining ( {
2518
2564
user : {
@@ -2695,7 +2741,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
2695
2741
// validate the session cookie
2696
2742
const sessionCookie = response . cookies . get ( "__session" ) ;
2697
2743
expect ( sessionCookie ) . toBeDefined ( ) ;
2698
- const { payload : session } = await decrypt ( sessionCookie ! . value , secret ) ;
2744
+ const { payload : session } = ( await decrypt (
2745
+ sessionCookie ! . value ,
2746
+ secret
2747
+ ) ) as jose . JWTDecryptResult ;
2699
2748
expect ( session ) . toEqual (
2700
2749
expect . objectContaining ( {
2701
2750
user : {
@@ -3081,10 +3130,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3081
3130
// validate the session cookie
3082
3131
const sessionCookie = response . cookies . get ( "__session" ) ;
3083
3132
expect ( sessionCookie ) . toBeDefined ( ) ;
3084
- const { payload : session } = await decrypt (
3133
+ const { payload : session } = ( await decrypt (
3085
3134
sessionCookie ! . value ,
3086
3135
secret
3087
- ) ;
3136
+ ) ) as jose . JWTDecryptResult ;
3088
3137
expect ( session ) . toEqual ( expect . objectContaining ( expectedSession ) ) ;
3089
3138
} ) ;
3090
3139
@@ -3545,10 +3594,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3545
3594
// validate the session cookie
3546
3595
const sessionCookie = response . cookies . get ( "__session" ) ;
3547
3596
expect ( sessionCookie ) . toBeDefined ( ) ;
3548
- const { payload : session } = await decrypt (
3597
+ const { payload : session } = ( await decrypt (
3549
3598
sessionCookie ! . value ,
3550
3599
secret
3551
- ) ;
3600
+ ) ) as jose . JWTDecryptResult ;
3552
3601
expect ( session ) . toEqual (
3553
3602
expect . objectContaining ( {
3554
3603
user : {
@@ -3679,10 +3728,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3679
3728
// validate the session cookie
3680
3729
const sessionCookie = response . cookies . get ( "__session" ) ;
3681
3730
expect ( sessionCookie ) . toBeDefined ( ) ;
3682
- const { payload : session } = await decrypt (
3731
+ const { payload : session } = ( await decrypt (
3683
3732
sessionCookie ! . value ,
3684
3733
secret
3685
- ) ;
3734
+ ) ) as jose . JWTDecryptResult ;
3686
3735
expect ( session ) . toEqual (
3687
3736
expect . objectContaining ( {
3688
3737
user : {
@@ -3783,10 +3832,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3783
3832
3784
3833
// validate that the session cookie has been updated
3785
3834
const updatedSessionCookie = response . cookies . get ( "__session" ) ;
3786
- const { payload : updatedSession } = await decrypt < SessionData > (
3835
+ const { payload : updatedSession } = ( await decrypt < SessionData > (
3787
3836
updatedSessionCookie ! . value ,
3788
3837
secret
3789
- ) ;
3838
+ ) ) as jose . JWTDecryptResult < SessionData > ;
3790
3839
expect ( updatedSession . tokenSet . accessToken ) . toEqual ( newAccessToken ) ;
3791
3840
} ) ;
3792
3841
0 commit comments