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 11{
22 "name" :" ColdBox Security" ,
3- "version" :" 2.4 .0" ,
3+ "version" :" 2.5 .0" ,
44 "location" :" https://downloads.ortussolutions.com/ortussolutions/coldbox-modules/cbsecurity/@build.version@/cbsecurity-@build.version@.zip" ,
55 "author" :" Ortus Solutions.com <info@ortussolutions.com>" ,
66 "slug" :" cbsecurity" ,
2929 ],
3030 "dependencies" :{
3131 "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"
3434 },
3535 "scripts" :{
3636 "toMaster" :" recipe build/toMaster.boxr" ,
Original file line number Diff line number Diff line change 11# CHANGELOG
22
3+ ## 2.5.0
4+
5+ * ` Feature ` : Upgraded to ` cbAuth ` @ 5.x
6+
37## 2.4.0
48
59* ` 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{
99 /**
1010 * Get the authenticated user
1111 *
12+ * @throws NoUserLoggedIn : If the user is not logged in
13+ *
1214 * @return User that implements IAuthUser
13- * @throws NoUserLoggedIn
1415 */
1516 any function getUser ();
1617
@@ -20,20 +21,24 @@ interface{
2021 boolean function isLoggedIn ();
2122
2223 /**
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
2425 *
2526 * @username The username to log in with
2627 * @password The password to log in with
2728 *
2829 * @throws InvalidCredentials
30+ *
31+ * @return User : The logged in user object
2932 */
30- boolean function authenticate ( required username , required password );
33+ any function authenticate ( required username , required password );
3134
3235 /**
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+ */
3742 function login ( required user );
3843
3944 /**
Original file line number Diff line number Diff line change @@ -136,15 +136,12 @@ component accessors="true" singleton {
136136 required password ,
137137 struct customClaims = {}
138138 ){
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 );
148145 }
149146
150147 /**
Original file line number Diff line number Diff line change 77 "dependencies" :{
88 "coldbox" :" ^5.0.0" ,
99 "testbox" :" be" ,
10- "cbauth" :" ^4 .0.0" ,
10+ "cbauth" :" ^5 .0.0" ,
1111 "BCrypt" :" ^2.5.0-snapshot" ,
1212 "jwt-cfml" :" ^1.0.0" ,
1313 "cbcsrf" :" ^2.0.0+21"
You can’t perform that action at this time.
0 commit comments