Skip to content

Scope "user" events

Blade will send some small payloads to the bus whenever a frontend User will be able to "login" or "logout" into/from current browser's session.

onUserLogin

Fired whenever a "user" (or a "customer") will login (successfully or not).

Let's review an example:

js
{
    success: true, 
    msg: 'Login effettuato con successo', 
    errors: [
        'Recaptcha challenge has been timed-out'
    ], 
    redirect: null, 
    customer_id: 1
}

Variables full details

Here you can find a detailed description of each variable or sub-branch:

VarTypeDescription
successboolIf the user has been successfully logged-in
msgstringMessage viewed by the user
errorserrorsArray of errors which have been encountered
redirectstring/nullRedirect the user to this URL after a successfull login
customer_idintCustomer unique id

onUserLogout

Fired whenever a "user" (or a "customer") will log out (successfully or not).

Let's review an example:

js
{
    success: true, 
    msg: 'Disconnessione avvenuta con successo; attendere il redirect automatico',
    redirect: null, 
    customer_id: 1
}

Variables full details

Here you can find a detailed description of each variable or sub-branch:

VarTypeDescription
successboolIf the user has been successfully logged-out
msgstringMessage viewed by the user
redirectstring/nullRedirect the user to this URL after a successfull login
customer_idintCustomer unique id

Released under the MIT License.