Skip to content

Commit 0d0b88e

Browse files
committed
fix: Respect cbSecurity's authenticationService setting in default validator
Use the new `CBSecurity` model to read `moduleSettings.cbSecurity.authenticationService` and return the *correct* authentication service per configuration.
1 parent 942e92b commit 0d0b88e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

models/validators/CBAuthValidator.cfc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
component singleton {
99

1010
// Injection
11-
property name="cbauth" inject="authenticationService@cbauth";
11+
property name="cbSecurity" inject="CBSecurity@cbSecurity";
1212

1313
/**
1414
* This function is called once an incoming event matches a security rule.
@@ -54,10 +54,10 @@ component singleton {
5454
};
5555

5656
// Are we logged in?
57-
if ( variables.cbauth.isLoggedIn() ) {
57+
if ( variables.cbSecurity.getAuthService().isLoggedIn() ) {
5858
// Do we have any permissions?
5959
if ( listLen( arguments.permissions ) ) {
60-
results.allow = variables.cbauth.getUser().hasPermission( arguments.permissions );
60+
results.allow = variables.cbSecurity.getAuthService().getUser().hasPermission( arguments.permissions );
6161
results.type = "authorization";
6262
} else {
6363
// We are satisfied!

0 commit comments

Comments
 (0)