File tree Expand file tree Collapse file tree 5 files changed +26
-20
lines changed Expand file tree Collapse file tree 5 files changed +26
-20
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" :" ColdBox Security" ,
3
- "version" :" 2.4 .0" ,
3
+ "version" :" 2.5 .0" ,
4
4
"location" :
" https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbsecurity/@build.version@/[email protected] @.zip" ,
5
5
"author" :
" Ortus Solutions.com <[email protected] >" ,
6
6
"slug" :" cbsecurity" ,
29
29
],
30
30
"dependencies" :{
31
31
"jwt-cfml" :" ^1.0.0" ,
32
- "cbauth" :" ^4 .0.0" ,
33
- "cbcsrf" :" ^2.0.0"
32
+ "cbauth" :" ^5 .0.0" ,
33
+ "cbcsrf" :" ^2.0.0"
34
34
},
35
35
"scripts" :{
36
36
"toMaster" :" recipe build/toMaster.boxr" ,
Original file line number Diff line number Diff line change 1
1
# CHANGELOG
2
2
3
+ ## 2.5.0
4
+
5
+ * ` Feature ` : Upgraded to ` cbAuth ` @ 5.x
6
+
3
7
## 2.4.0
4
8
5
9
* ` Feature ` : We now include the ` cbcsrf ` module to allow for protections of cross site request forgery vectors. Please see all the features included in this module here: https://github.com/coldbox-modules/cbcsrf
Original file line number Diff line number Diff line change @@ -9,8 +9,9 @@ interface{
9
9
/**
10
10
* Get the authenticated user
11
11
*
12
+ * @throws NoUserLoggedIn : If the user is not logged in
13
+ *
12
14
* @return User that implements IAuthUser
13
- * @throws NoUserLoggedIn
14
15
*/
15
16
any function getUser ();
16
17
@@ -20,20 +21,24 @@ interface{
20
21
boolean function isLoggedIn ();
21
22
22
23
/**
23
- * Attemps to log in a user
24
+ * Try to authenticate a user into the system. If the authentication fails an exception is thrown, else the logged in user object is returned
24
25
*
25
26
* @username The username to log in with
26
27
* @password The password to log in with
27
28
*
28
29
* @throws InvalidCredentials
30
+ *
31
+ * @return User : The logged in user object
29
32
*/
30
- boolean function authenticate ( required username , required password );
33
+ any function authenticate ( required username , required password );
31
34
32
35
/**
33
- * Logs a user into the system
34
- *
35
- * @user The user object that implements IAuthUser
36
- */
36
+ * Login a user into our persistent scopes
37
+ *
38
+ * @user The user object to log in
39
+ *
40
+ * @return The same user object so you can do functional goodness
41
+ */
37
42
function login ( required user );
38
43
39
44
/**
Original file line number Diff line number Diff line change @@ -136,15 +136,12 @@ component accessors="true" singleton {
136
136
required password ,
137
137
struct customClaims = {}
138
138
){
139
- var auth = cbSecurity .getAuthService ();
140
-
141
- if ( auth .authenticate ( arguments .username , arguments .password ) ) {
142
- // Create it
143
- return fromUser ( auth .getUser (), arguments .customClaims );
144
- } else {
145
- // Can't do anything if the authenticate is false.
146
- throw ( message = " The credentials are invalid!" , type = " InvalidCredentials" );
147
- }
139
+ var oUser = cbSecurity
140
+ .getAuthService ()
141
+ .authenticate ( arguments .username , arguments .password );
142
+
143
+ // Create it
144
+ return fromUser ( oUser , arguments .customClaims );
148
145
}
149
146
150
147
/**
Original file line number Diff line number Diff line change 7
7
"dependencies" :{
8
8
"coldbox" :" ^5.0.0" ,
9
9
"testbox" :" be" ,
10
- "cbauth" :" ^4 .0.0" ,
10
+ "cbauth" :" ^5 .0.0" ,
11
11
"BCrypt" :" ^2.5.0-snapshot" ,
12
12
"jwt-cfml" :" ^1.0.0" ,
13
13
"cbcsrf" :" ^2.0.0+21"
You can’t perform that action at this time.
0 commit comments