Skip to content

Commit 8854c3e

Browse files
committed
fixes to user services
1 parent f8425f8 commit 8854c3e

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed

interfaces/IUserService.cfc

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,27 @@
66
*/
77
interface{
88

9-
/**
10-
* Retrieve a user by unique identifier
11-
*
12-
* @id The unique identifier
13-
*
14-
* @return User that implements JWTSubject and/or IAuthUser
15-
*/
16-
any function get( required id );
9+
/**
10+
* Verify if the incoming username/password are valid credentials.
11+
*
12+
* @username The username
13+
* @password The password
14+
*/
15+
boolean function isValidCredentials( required username, required password );
1716

17+
/**
18+
* Retrieve a user by username
19+
*
20+
* @return User that implements JWTSubject and/or IAuthUser
21+
*/
22+
function retrieveUserByUsername( required username );
23+
24+
/**
25+
* Retrieve a user by unique identifier
26+
*
27+
* @id The unique identifier
28+
*
29+
* @return User that implements JWTSubject and/or IAuthUser
30+
*/
31+
function retrieveUserById( required id );
1832
}

models/jwt/JwtService.cfc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ component accessors="true" singleton{
143143
*/
144144
function authenticate(){
145145
// Get the User it represents
146-
var oUser = getUserService().get( getPayload().sub );
146+
var oUser = getUserService().retrieveUserById( getPayload().sub );
147147

148148
// Verify it
149149
if( isNull( oUser ) || !len( oUser.getId() ) ){

0 commit comments

Comments
 (0)