Security
onSecure() Lifecycle Method
// wires/AdminDashboard.bx
class extends="cbwire.models.Component" {
property name="authService" inject="AuthService";
data = {
"stats": {}
};
function onSecure( event, rc, prc, isInitial, params ) {
// Check authentication
if ( !authService.isLoggedIn() ) {
return false;
}
// Check authorization
if ( !authService.hasRole( "admin" ) ) {
return false;
}
}
function onMount() {
data.stats = getAdminStats();
}
}Parameters
Parameter
Type
Description
Custom Failure Messages
cbSecurity Integration
Component-Level Security
Method-Level Security
Annotation Formats
Security Interceptor
Checksum Validation
How It Works
Configuration
Error Handling
CSRF Protection
How It Works
Configuration
Storage Implementations
SessionCSRFStorage (Default)
CacheCSRFStorage
Custom Storage
Changes in 5.x
Last updated
Was this helpful?