File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
test-harness/tests/specs/integration Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -91,9 +91,8 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
91
91
then ( " it should block with no authorization" , function (){
92
92
var thisToken = getInstance ( " jwtService@cbSecurity" ).attempt ( " test" , " test" );
93
93
94
- getController ()
95
- .getCacheBox ()
96
- .getCache ( " default" )
94
+ getInstance ( " jwtService@cbSecurity" )
95
+ .getTokenStorage ()
97
96
.clearAll ();
98
97
getRequestContext ().setValue ( " x-auth-token" , this Token );
99
98
var event = execute ( route = " /api/secure" , renderResults = true );
@@ -111,10 +110,14 @@ component extends="coldbox.system.testing.BaseTestCase" appMapping="/root" {
111
110
var thisToken = getInvalidUserToken ();
112
111
getRequestContext ().setValue ( " x-auth-token" , this Token .token );
113
112
114
- getController ()
115
- .getCacheBox ()
116
- .getCache ( " default" )
117
- .set ( " cbjwt_#this Token .payload .jti #" , this Token );
113
+ getInstance ( " jwtService@cbSecurity" )
114
+ .getTokenStorage ()
115
+ .set (
116
+ key = this Token .payload .jti ,
117
+ token = this Token .token ,
118
+ expiration = 2 ,
119
+ payload = this Token .payload
120
+ );
118
121
var event = execute ( route = " /api/secure" , renderResults = true );
119
122
120
123
expect ( event .getCurrentEvent () ).toBe ( " api:Home.onInvalidAuth" );
You can’t perform that action at this time.
0 commit comments