Skip to content

Commit b65dd5f

Browse files
committed
* Added storage of the authenticated user into the prc scope when using attempt() to be consistent with API calls
1 parent 7bdcda3 commit b65dd5f

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

changelog.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
----
99

10+
## [2.8.0] =>
11+
12+
### Added
13+
14+
* Added storage of the authenticated user into the `prc` scope when using `attempt()` to be consistent with API calls
15+
16+
----
17+
1018
## [2.7.0] => 2020-SEP-14
1119

1220
### Added

models/jwt/JwtService.cfc

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,11 +136,18 @@ component accessors="true" singleton {
136136
required password,
137137
struct customClaims = {}
138138
){
139+
// Authenticate via the auth service wired up
140+
// If it fails an exception is thrown
139141
var oUser = cbSecurity
140142
.getAuthService()
141143
.authenticate( arguments.username, arguments.password );
142144

143-
// Create it
145+
// Store User in ColdBox data bus
146+
variables.requestService
147+
.getContext()
148+
.setPrivateValue( variables.settings.prcUserVariable, oUser );
149+
150+
// Create the token and return it
144151
return fromUser( oUser, arguments.customClaims );
145152
}
146153

0 commit comments

Comments
 (0)