Skip to content

Commit 3c05d31

Browse files
committed
Added a new convenience method on the JWT Service: isTokenInStorage( token ) to verify if a token still exists in the token storage
1 parent c7dae9e commit 3c05d31

File tree

3 files changed

+17
-7
lines changed

3 files changed

+17
-7
lines changed

changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
## 2.2.0
44

5+
* `Feature` : Added a new convenience method on the JWT Service: `isTokenInStorage( token )` to verify if a token still exists in the token storage
56
* `Bug` : Invalidation of tokens was not happening due to not using the actual key for the storage
67

78
## 2.1.0

models/jwt/JwtService.cfc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,15 @@ component accessors="true" singleton{
222222
return results;
223223
}
224224

225+
/**
226+
* Verifies if the passed in token exists in the storage provider
227+
*
228+
* @token The token to check
229+
*/
230+
boolean function isTokenInStorage( required token ){
231+
return getTokenStorage().exists( this.decode( arguments.token ).jti );
232+
}
233+
225234
/************************************************************************************/
226235
/****************************** PARSING + COLDBOX INTEGRATION METHODS ***************/
227236
/************************************************************************************/

test-harness/box.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"coldbox":"^5.0.0",
99
"testbox":"be",
1010
"jwt":"^1.1.0",
11-
"cbauth":"^3.0.0",
11+
"cbauth":"^4.0.0",
1212
"BCrypt":"^2.5.0-snapshot"
1313
},
1414
"devDependencies":{
@@ -24,10 +24,10 @@
2424
},
2525
"testbox":{
2626
"runner":"http://localhost:60299/tests/runner.cfm"
27-
},
28-
"scripts" : {
29-
"format": "cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --overwrite",
30-
"format:watch": "cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --watch",
31-
"format:check": "cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --check"
32-
}
27+
},
28+
"scripts":{
29+
"format":"cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --overwrite",
30+
"format:watch":"cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --watch",
31+
"format:check":"cfformat config/**.cfc,handlers/**.cfc,models/**.cfc,modules_app/**.cfc,tests/specs/**/*.cfc --check"
32+
}
3333
}

0 commit comments

Comments
 (0)