@@ -520,10 +520,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
520
520
// assert session has been updated
521
521
const updatedSessionCookie = response . cookies . get ( "__session" ) ;
522
522
expect ( updatedSessionCookie ) . toBeDefined ( ) ;
523
- const { payload : updatedSessionCookieValue } = await decrypt (
523
+ const { payload : updatedSessionCookieValue } = ( await decrypt (
524
524
updatedSessionCookie ! . value ,
525
525
secret
526
- ) ;
526
+ ) ) as jose . JWTDecryptResult ;
527
527
expect ( updatedSessionCookieValue ) . toEqual (
528
528
expect . objectContaining ( {
529
529
user : {
@@ -960,7 +960,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
960
960
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
961
961
) ;
962
962
expect ( transactionCookie ) . toBeDefined ( ) ;
963
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
963
+ expect (
964
+ (
965
+ ( await decrypt (
966
+ transactionCookie ! . value ,
967
+ secret
968
+ ) ) as jose . JWTDecryptResult
969
+ ) . payload
970
+ ) . toEqual (
964
971
expect . objectContaining ( {
965
972
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
966
973
codeVerifier : expect . any ( String ) ,
@@ -1164,7 +1171,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1164
1171
) ;
1165
1172
expect ( transactionCookie ) . toBeDefined ( ) ;
1166
1173
expect (
1167
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1174
+ (
1175
+ ( await decrypt (
1176
+ transactionCookie ! . value ,
1177
+ secret
1178
+ ) ) as jose . JWTDecryptResult
1179
+ ) . payload
1168
1180
) . toEqual (
1169
1181
expect . objectContaining ( {
1170
1182
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
@@ -1499,7 +1511,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1499
1511
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1500
1512
) ;
1501
1513
expect ( transactionCookie ) . toBeDefined ( ) ;
1502
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1514
+ expect (
1515
+ (
1516
+ ( await decrypt (
1517
+ transactionCookie ! . value ,
1518
+ secret
1519
+ ) ) as jose . JWTDecryptResult
1520
+ ) . payload
1521
+ ) . toEqual (
1503
1522
expect . objectContaining ( {
1504
1523
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1505
1524
maxAge : 3600 ,
@@ -1546,7 +1565,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1546
1565
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1547
1566
) ;
1548
1567
expect ( transactionCookie ) . toBeDefined ( ) ;
1549
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1568
+ expect (
1569
+ (
1570
+ ( await decrypt (
1571
+ transactionCookie ! . value ,
1572
+ secret
1573
+ ) ) as jose . JWTDecryptResult
1574
+ ) . payload
1575
+ ) . toEqual (
1550
1576
expect . objectContaining ( {
1551
1577
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1552
1578
codeVerifier : expect . any ( String ) ,
@@ -1592,7 +1618,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
1592
1618
`__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
1593
1619
) ;
1594
1620
expect ( transactionCookie ) . toBeDefined ( ) ;
1595
- expect ( ( await decrypt ( transactionCookie ! . value , secret ) ) . payload ) . toEqual (
1621
+ expect (
1622
+ (
1623
+ ( await decrypt (
1624
+ transactionCookie ! . value ,
1625
+ secret
1626
+ ) ) as jose . JWTDecryptResult
1627
+ ) . payload
1628
+ ) . toEqual (
1596
1629
expect . objectContaining ( {
1597
1630
nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
1598
1631
codeVerifier : expect . any ( String ) ,
@@ -1726,7 +1759,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1726
1759
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1727
1760
expect ( transactionCookie ) . toBeDefined ( ) ;
1728
1761
expect (
1729
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1762
+ (
1763
+ ( await decrypt (
1764
+ transactionCookie . value ,
1765
+ secret
1766
+ ) ) as jose . JWTDecryptResult
1767
+ ) . payload
1730
1768
) . toEqual (
1731
1769
expect . objectContaining ( {
1732
1770
nonce : expect . any ( String ) ,
@@ -1880,7 +1918,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
1880
1918
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1881
1919
expect ( transactionCookie ) . toBeDefined ( ) ;
1882
1920
expect (
1883
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1921
+ (
1922
+ ( await decrypt (
1923
+ transactionCookie . value ,
1924
+ secret
1925
+ ) ) as jose . JWTDecryptResult
1926
+ ) . payload
1884
1927
) . toEqual (
1885
1928
expect . objectContaining ( {
1886
1929
nonce : expect . any ( String ) ,
@@ -1962,7 +2005,7 @@ ca/T0LLtgmbMmxSv/MmzIg==
1962
2005
const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
1963
2006
expect ( transactionCookie ) . toBeDefined ( ) ;
1964
2007
expect (
1965
- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
2008
+ ( await decrypt ( transactionCookie ! . value , secret ) ) ! . payload
1966
2009
) . toEqual (
1967
2010
expect . objectContaining ( {
1968
2011
nonce : expect . any ( String ) ,
@@ -2554,7 +2597,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
2554
2597
// validate the session cookie
2555
2598
const sessionCookie = response . cookies . get ( "__session" ) ;
2556
2599
expect ( sessionCookie ) . toBeDefined ( ) ;
2557
- const { payload : session } = await decrypt ( sessionCookie ! . value , secret ) ;
2600
+ const { payload : session } = ( await decrypt (
2601
+ sessionCookie ! . value ,
2602
+ secret
2603
+ ) ) as jose . JWTDecryptResult ;
2558
2604
expect ( session ) . toEqual (
2559
2605
expect . objectContaining ( {
2560
2606
user : {
@@ -2735,7 +2781,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
2735
2781
// validate the session cookie
2736
2782
const sessionCookie = response . cookies . get ( "__session" ) ;
2737
2783
expect ( sessionCookie ) . toBeDefined ( ) ;
2738
- const { payload : session } = await decrypt ( sessionCookie ! . value , secret ) ;
2784
+ const { payload : session } = ( await decrypt (
2785
+ sessionCookie ! . value ,
2786
+ secret
2787
+ ) ) as jose . JWTDecryptResult ;
2739
2788
expect ( session ) . toEqual (
2740
2789
expect . objectContaining ( {
2741
2790
user : {
@@ -3119,10 +3168,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3119
3168
// validate the session cookie
3120
3169
const sessionCookie = response . cookies . get ( "__session" ) ;
3121
3170
expect ( sessionCookie ) . toBeDefined ( ) ;
3122
- const { payload : session } = await decrypt (
3171
+ const { payload : session } = ( await decrypt (
3123
3172
sessionCookie ! . value ,
3124
3173
secret
3125
- ) ;
3174
+ ) ) as jose . JWTDecryptResult ;
3126
3175
expect ( session ) . toEqual ( expect . objectContaining ( expectedSession ) ) ;
3127
3176
} ) ;
3128
3177
@@ -3662,10 +3711,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3662
3711
// validate the session cookie
3663
3712
const sessionCookie = response . cookies . get ( "__session" ) ;
3664
3713
expect ( sessionCookie ) . toBeDefined ( ) ;
3665
- const { payload : session } = await decrypt (
3714
+ const { payload : session } = ( await decrypt (
3666
3715
sessionCookie ! . value ,
3667
3716
secret
3668
- ) ;
3717
+ ) ) as jose . JWTDecryptResult ;
3669
3718
expect ( session ) . toEqual (
3670
3719
expect . objectContaining ( {
3671
3720
user : {
@@ -3796,10 +3845,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3796
3845
// validate the session cookie
3797
3846
const sessionCookie = response . cookies . get ( "__session" ) ;
3798
3847
expect ( sessionCookie ) . toBeDefined ( ) ;
3799
- const { payload : session } = await decrypt (
3848
+ const { payload : session } = ( await decrypt (
3800
3849
sessionCookie ! . value ,
3801
3850
secret
3802
- ) ;
3851
+ ) ) as jose . JWTDecryptResult ;
3803
3852
expect ( session ) . toEqual (
3804
3853
expect . objectContaining ( {
3805
3854
user : {
@@ -3900,10 +3949,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
3900
3949
3901
3950
// validate that the session cookie has been updated
3902
3951
const updatedSessionCookie = response . cookies . get ( "__session" ) ;
3903
- const { payload : updatedSession } = await decrypt < SessionData > (
3952
+ const { payload : updatedSession } = ( await decrypt < SessionData > (
3904
3953
updatedSessionCookie ! . value ,
3905
3954
secret
3906
- ) ;
3955
+ ) ) as jose . JWTDecryptResult < SessionData > ;
3907
3956
expect ( updatedSession . tokenSet . accessToken ) . toEqual ( newAccessToken ) ;
3908
3957
} ) ;
3909
3958
0 commit comments