@@ -520,10 +520,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
520520 // assert session has been updated
521521 const updatedSessionCookie = response . cookies . get ( "__session" ) ;
522522 expect ( updatedSessionCookie ) . toBeDefined ( ) ;
523- const { payload : updatedSessionCookieValue } = await decrypt (
523+ const { payload : updatedSessionCookieValue } = ( await decrypt (
524524 updatedSessionCookie ! . value ,
525525 secret
526- ) ;
526+ ) ) as jose . JWTDecryptResult ;
527527 expect ( updatedSessionCookieValue ) . toEqual (
528528 expect . objectContaining ( {
529529 user : {
@@ -960,7 +960,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
960960 `__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
961961 ) ;
962962 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 (
964971 expect . objectContaining ( {
965972 nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
966973 codeVerifier : expect . any ( String ) ,
@@ -1164,7 +1171,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
11641171 ) ;
11651172 expect ( transactionCookie ) . toBeDefined ( ) ;
11661173 expect (
1167- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1174+ (
1175+ ( await decrypt (
1176+ transactionCookie ! . value ,
1177+ secret
1178+ ) ) as jose . JWTDecryptResult
1179+ ) . payload
11681180 ) . toEqual (
11691181 expect . objectContaining ( {
11701182 nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
@@ -1499,7 +1511,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
14991511 `__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
15001512 ) ;
15011513 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 (
15031522 expect . objectContaining ( {
15041523 nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
15051524 maxAge : 3600 ,
@@ -1546,7 +1565,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
15461565 `__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
15471566 ) ;
15481567 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 (
15501576 expect . objectContaining ( {
15511577 nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
15521578 codeVerifier : expect . any ( String ) ,
@@ -1592,7 +1618,14 @@ ca/T0LLtgmbMmxSv/MmzIg==
15921618 `__txn_${ authorizationUrl . searchParams . get ( "state" ) } `
15931619 ) ;
15941620 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 (
15961629 expect . objectContaining ( {
15971630 nonce : authorizationUrl . searchParams . get ( "nonce" ) ,
15981631 codeVerifier : expect . any ( String ) ,
@@ -1726,7 +1759,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
17261759 const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
17271760 expect ( transactionCookie ) . toBeDefined ( ) ;
17281761 expect (
1729- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1762+ (
1763+ ( await decrypt (
1764+ transactionCookie . value ,
1765+ secret
1766+ ) ) as jose . JWTDecryptResult
1767+ ) . payload
17301768 ) . toEqual (
17311769 expect . objectContaining ( {
17321770 nonce : expect . any ( String ) ,
@@ -1880,7 +1918,12 @@ ca/T0LLtgmbMmxSv/MmzIg==
18801918 const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
18811919 expect ( transactionCookie ) . toBeDefined ( ) ;
18821920 expect (
1883- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
1921+ (
1922+ ( await decrypt (
1923+ transactionCookie . value ,
1924+ secret
1925+ ) ) as jose . JWTDecryptResult
1926+ ) . payload
18841927 ) . toEqual (
18851928 expect . objectContaining ( {
18861929 nonce : expect . any ( String ) ,
@@ -1962,7 +2005,7 @@ ca/T0LLtgmbMmxSv/MmzIg==
19622005 const state = transactionCookie . name . replace ( "__txn_" , "" ) ;
19632006 expect ( transactionCookie ) . toBeDefined ( ) ;
19642007 expect (
1965- ( await decrypt ( transactionCookie ! . value , secret ) ) . payload
2008+ ( await decrypt ( transactionCookie ! . value , secret ) ) ! . payload
19662009 ) . toEqual (
19672010 expect . objectContaining ( {
19682011 nonce : expect . any ( String ) ,
@@ -2554,7 +2597,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
25542597 // validate the session cookie
25552598 const sessionCookie = response . cookies . get ( "__session" ) ;
25562599 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 ;
25582604 expect ( session ) . toEqual (
25592605 expect . objectContaining ( {
25602606 user : {
@@ -2735,7 +2781,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
27352781 // validate the session cookie
27362782 const sessionCookie = response . cookies . get ( "__session" ) ;
27372783 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 ;
27392788 expect ( session ) . toEqual (
27402789 expect . objectContaining ( {
27412790 user : {
@@ -3119,10 +3168,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
31193168 // validate the session cookie
31203169 const sessionCookie = response . cookies . get ( "__session" ) ;
31213170 expect ( sessionCookie ) . toBeDefined ( ) ;
3122- const { payload : session } = await decrypt (
3171+ const { payload : session } = ( await decrypt (
31233172 sessionCookie ! . value ,
31243173 secret
3125- ) ;
3174+ ) ) as jose . JWTDecryptResult ;
31263175 expect ( session ) . toEqual ( expect . objectContaining ( expectedSession ) ) ;
31273176 } ) ;
31283177
@@ -3662,10 +3711,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
36623711 // validate the session cookie
36633712 const sessionCookie = response . cookies . get ( "__session" ) ;
36643713 expect ( sessionCookie ) . toBeDefined ( ) ;
3665- const { payload : session } = await decrypt (
3714+ const { payload : session } = ( await decrypt (
36663715 sessionCookie ! . value ,
36673716 secret
3668- ) ;
3717+ ) ) as jose . JWTDecryptResult ;
36693718 expect ( session ) . toEqual (
36703719 expect . objectContaining ( {
36713720 user : {
@@ -3796,10 +3845,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
37963845 // validate the session cookie
37973846 const sessionCookie = response . cookies . get ( "__session" ) ;
37983847 expect ( sessionCookie ) . toBeDefined ( ) ;
3799- const { payload : session } = await decrypt (
3848+ const { payload : session } = ( await decrypt (
38003849 sessionCookie ! . value ,
38013850 secret
3802- ) ;
3851+ ) ) as jose . JWTDecryptResult ;
38033852 expect ( session ) . toEqual (
38043853 expect . objectContaining ( {
38053854 user : {
@@ -3900,10 +3949,10 @@ ca/T0LLtgmbMmxSv/MmzIg==
39003949
39013950 // validate that the session cookie has been updated
39023951 const updatedSessionCookie = response . cookies . get ( "__session" ) ;
3903- const { payload : updatedSession } = await decrypt < SessionData > (
3952+ const { payload : updatedSession } = ( await decrypt < SessionData > (
39043953 updatedSessionCookie ! . value ,
39053954 secret
3906- ) ;
3955+ ) ) as jose . JWTDecryptResult < SessionData > ;
39073956 expect ( updatedSession . tokenSet . accessToken ) . toEqual ( newAccessToken ) ;
39083957 } ) ;
39093958
0 commit comments