# AuthEvent events

> 18 FeatherPanel plugin events on AuthEvent (18 emitted by the core): the event names, the arguments each listener gets, where they fire and a PHP listener for each.

Source: https://featherpanel.com/docs/plugins/events/auth/

Part of the [plugin events reference](https://featherpanel.com/docs/plugins/events/). Listeners get the payload values as positional arguments in the order shown, cannot cancel the action, and must catch their own exceptions.

## Setup

Import `AuthEvent` in your entry class and register listeners in `processEvents()`:

```php
<?php

namespace App\Addons\myplugin;

use App\App;
use App\Plugins\AppPlugin;
use App\Plugins\PluginEvents;
use App\Plugins\Events\Events\AuthEvent;

class MyPlugin implements AppPlugin
{
    public static function processEvents(PluginEvents $event): void
    {
        $event->on(AuthEvent::onAuthEmailLoginCodeRequested(), function ($user, $ipAddress): void {
            App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:email:login:code:requested ' . json_encode(['user' => $user, 'ip_address' => $ipAddress]));
        });
    }

    public static function pluginInstall(): void
    {
    }

    public static function pluginUninstall(): void
    {
    }
}
```

## `AuthEvent::onAuth2FAEnabled()`

- Name: `featherpanel:auth:2fa:enabled`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L84)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |

When it fires (1 site)

-   [`TwoFactorController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/TwoFactorController.php#L183)[`PUT /api/user/auth/two-factor`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-two-factor)

```php
$event->on(AuthEvent::onAuth2FAEnabled(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:2fa:enabled ' . json_encode(['user' => $user]));
});
```

## `AuthEvent::onAuth2FAFailed()`

- Name: `featherpanel:auth:2fa:failed`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L100)

Docblock: array user info. (the emitter passes 2 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | not declared |
| 2 | `ip_address` | `$ipAddress` | not declared |

When it fires (1 site)

-   [`TwoFactorController::post`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/TwoFactorController.php#L325)[`POST /api/user/auth/two-factor`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-two-factor)

```php
$event->on(AuthEvent::onAuth2FAFailed(), function ($user, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:2fa:failed');
});
```

## `AuthEvent::onAuth2FASetup()`

- Name: `featherpanel:auth:2fa:setup`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L76)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |

When it fires (1 site)

-   [`TwoFactorController::get`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/TwoFactorController.php#L235)[`GET /api/user/auth/two-factor`](https://featherpanel.com/docs/api/reference/user/auth/#get-user-auth-two-factor)

```php
$event->on(AuthEvent::onAuth2FASetup(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:2fa:setup ' . json_encode(['user' => $user]));
});
```

## `AuthEvent::onAuth2FAVerified()`

- Name: `featherpanel:auth:2fa:verified`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L92)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |

When it fires (1 site)

-   [`TwoFactorController::post`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/TwoFactorController.php#L368)[`POST /api/user/auth/two-factor`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-two-factor)

```php
$event->on(AuthEvent::onAuth2FAVerified(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:2fa:verified ' . json_encode(['user' => $user]));
});
```

## `AuthEvent::onAuthAccountLocked()`

- Name: `featherpanel:auth:account:locked`
- emitted at 6 sites
- 2 payload shapes
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L124)

Docblock: array user info. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `identifier` | `$identifier` | `string` |
| 2 | `lockout_seconds` | `$lockoutSeconds` | `int|null` |
| 3 | `attempts` | `$attempts`not at every site | `int` |

| Arguments passed | Emitted from |
| --- | --- |
| `identifier`, `lockout_seconds`, `attempts` | 
`AccountLockoutHelper::reserveHardLockAttempt`

`AccountLockoutHelper::recordFailure`

`AccountLockoutHelper::recordFailure`

`AccountLockoutHelper::reserveHardLockAttemptViaFileStore`

 |
| `identifier`, `lockout_seconds`, `already_locked` | 

`AccountLockoutHelper::reserveHardLockAttempt`

`AccountLockoutHelper::reserveHardLockAttemptViaFileStore`

 |

When it fires (6 sites)

-   [`AccountLockoutHelper::reserveHardLockAttempt`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L176) via `emitAuthEvent()`
-   [`AccountLockoutHelper::reserveHardLockAttempt`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L182) via `emitAuthEvent()`
-   [`AccountLockoutHelper::recordFailure`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L225) via `emitAuthEvent()`
-   [`AccountLockoutHelper::recordFailure`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L243) via `emitAuthEvent()`
-   [`AccountLockoutHelper::reserveHardLockAttemptViaFileStore`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L317) via `emitAuthEvent()`
-   [`AccountLockoutHelper::reserveHardLockAttemptViaFileStore`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L340) via `emitAuthEvent()`

```php
$event->on(AuthEvent::onAuthAccountLocked(), function ($identifier, $lockoutSeconds, ...$rest): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:account:locked ' . json_encode(['identifier' => $identifier, 'lockout_seconds' => $lockoutSeconds]));
});
```

## `AuthEvent::onAuthAccountUnlocked()`

- Name: `featherpanel:auth:account:unlocked`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L132)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `identifier` | `$identifier` | `string` |

When it fires (2 sites)

-   [`AccountLockoutHelper::clear`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L272) via `emitAuthEvent()`
-   [`AccountLockoutHelper::clear`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Helpers/AccountLockoutHelper.php#L284) via `emitAuthEvent()`

```php
$event->on(AuthEvent::onAuthAccountUnlocked(), function ($identifier): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:account:unlocked ' . json_encode(['identifier' => $identifier]));
});
```

## `AuthEvent::onAuthEmailChanged()`

- Name: `featherpanel:auth:email:changed`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L116)

Docblock: array user info, string email. (the emitter passes 4 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | not declared |
| 2 | `old_email` | `$oldEmail` | not declared |
| 3 | `new_email` | `$newEmail` | not declared |
| 4 | `ip_address` | `$ipAddress` | not declared |

When it fires (1 site)

-   [`SessionController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/User/SessionController.php#L344)[`PATCH /api/user/session`](https://featherpanel.com/docs/api/reference/user/session/#patch-user-session)

```php
$event->on(AuthEvent::onAuthEmailChanged(), function ($userUuid, $oldEmail, $newEmail, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:email:changed');
});
```

## `AuthEvent::onAuthEmailLoginCodeRequested()`

- Name: `featherpanel:auth:email:login:code:requested`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L164)

Docblock: array user info, string ip\_address.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |
| 2 | `ip_address` | `$ipAddress` | `string`from docblock |

When it fires (1 site)

-   [`EmailLoginController::requestCode`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/EmailLoginController.php#L213)[`POST /api/user/auth/email-login/request`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-email-login-request)

```php
$event->on(AuthEvent::onAuthEmailLoginCodeRequested(), function ($user, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:email:login:code:requested ' . json_encode(['user' => $user, 'ip_address' => $ipAddress]));
});
```

## `AuthEvent::onAuthForgotPassword()`

- Name: `featherpanel:auth:forgot:password`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L60)

Docblock: array user info, string reset\_url, string reset\_token. (the emitter passes 4 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | not declared |
| 2 | `reset_url` | `$resetUrl` | not declared |
| 3 | `ip_address` | `$ipAddress` | not declared |
| 4 | `reset_token` | `$resetToken` | not declared |

When it fires (1 site)

-   [`ForgotPasswordController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/ForgotPasswordController.php#L194)[`PUT /api/user/auth/forgot-password`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-forgot-password)

```php
$event->on(AuthEvent::onAuthForgotPassword(), function ($user, $resetUrl, $ipAddress, $resetToken): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:forgot:password');
});
```

## `AuthEvent::onAuthForgotPasswordFailed()`

- Name: `featherpanel:auth:forgot:password:failed`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L156)

Docblock: string email, string reason. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `email` | `$email` | not declared |
| 2 | `reason` | `$reason` | `string` |
| 3 | `ip_address` | `$ipAddress` | not declared |

When it fires (1 site)

-   [`ForgotPasswordController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/ForgotPasswordController.php#L143)[`PUT /api/user/auth/forgot-password`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-forgot-password)

```php
$event->on(AuthEvent::onAuthForgotPasswordFailed(), function ($email, $reason, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:forgot:password:failed ' . json_encode(['reason' => $reason]));
});
```

## `AuthEvent::onAuthLoginFailed()`

- Name: `featherpanel:auth:login:failed`
- emitted at 8 sites
- 4 payload shapes
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L36)

Docblock: positional values from the emitted payload in key insertion order (see PluginEvents::emit). Possible keys across emitters: email, error, ip\_address, provider, reason, user, username, username\_or\_email. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user`not at every site | not declared |
| 2 | `reason` | `$reason`not at every site | `string` |
| 3 | `ip_address` | `$ipAddress`not at every site | not declared |

| Arguments passed | Emitted from |
| --- | --- |
| `user`, `reason`, `ip_address` | 
`EmailLoginController::requestCode`

`EmailLoginController::verifyCode`

`LdapController::login`

`LoginController::put`

`LoginController::put`

 |
| `email`, `reason`, `ip_address` | 

`EmailLoginController::requestCode`

 |
| `username`, `provider`, `reason`, `error`, `ip_address` | 

`LdapController::login`

 |
| `username_or_email`, `reason`, `ip_address` | 

`LoginController::put`

 |

When it fires (8 sites)

-   [`EmailLoginController::requestCode`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/EmailLoginController.php#L133)[`POST /api/user/auth/email-login/request`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-email-login-request)
-   [`EmailLoginController::requestCode`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/EmailLoginController.php#L153)[`POST /api/user/auth/email-login/request`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-email-login-request)
-   [`EmailLoginController::verifyCode`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/EmailLoginController.php#L334)[`POST /api/user/auth/email-login/verify`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-email-login-verify)
-   [`LdapController::login`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LdapController.php#L142)[`PUT /api/user/auth/ldap/login`](https://featherpanel.com/docs/api/reference/user/ldap/#put-user-auth-ldap-login)
-   [`LdapController::login`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LdapController.php#L200)[`PUT /api/user/auth/ldap/login`](https://featherpanel.com/docs/api/reference/user/ldap/#put-user-auth-ldap-login)
-   [`LoginController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LoginController.php#L209)[`PUT /api/user/auth/login`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-login)
-   [`LoginController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LoginController.php#L231)[`PUT /api/user/auth/login`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-login)
-   [`LoginController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LoginController.php#L268)[`PUT /api/user/auth/login`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-login)

```php
$event->on(AuthEvent::onAuthLoginFailed(), function (...$rest): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:login:failed');
});
```

## `AuthEvent::onAuthLoginSuccess()`

- Name: `featherpanel:auth:login:success`
- emitted at 3 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L27)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array` |

When it fires (3 sites)

-   [`LoginController::completeLogin`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/LoginController.php#L360)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L397)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`TwoFactorController::post`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/TwoFactorController.php#L374)[`POST /api/user/auth/two-factor`](https://featherpanel.com/docs/api/reference/user/auth/#post-user-auth-two-factor)

```php
$event->on(AuthEvent::onAuthLoginSuccess(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:login:success ' . json_encode(['user' => $user]));
});
```

## `AuthEvent::onAuthLogout()`

- Name: `featherpanel:auth:logout`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L44)

Docblock: array user info.

Emitted without a payload; the listener takes no arguments.

When it fires (2 sites)

-   [`AuthLogoutController::get`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/AuthLogoutController.php#L75)[`GET /api/user/auth/logout`](https://featherpanel.com/docs/api/reference/user/auth/#get-user-auth-logout), [`DELETE /api/user/auth/logout`](https://featherpanel.com/docs/api/reference/user/auth/#delete-user-auth-logout)
-   [`AuthLogoutController::get`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/AuthLogoutController.php#L104)[`GET /api/user/auth/logout`](https://featherpanel.com/docs/api/reference/user/auth/#get-user-auth-logout), [`DELETE /api/user/auth/logout`](https://featherpanel.com/docs/api/reference/user/auth/#delete-user-auth-logout)

```php
$event->on(AuthEvent::onAuthLogout(), function (): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:logout');
});
```

## `AuthEvent::onAuthPasswordChanged()`

- Name: `featherpanel:auth:password:changed`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L108)

Docblock: array user info. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user_uuid` | `$userUuid` | not declared |
| 2 | `user` | `$user` | not declared |
| 3 | `ip_address` | `$ipAddress` | not declared |

When it fires (1 site)

-   [`SessionController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/User/SessionController.php#L334)[`PATCH /api/user/session`](https://featherpanel.com/docs/api/reference/user/session/#patch-user-session)

```php
$event->on(AuthEvent::onAuthPasswordChanged(), function ($userUuid, $user, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:password:changed');
});
```

## `AuthEvent::onAuthPasswordResetFailed()`

- Name: `featherpanel:auth:password:reset:failed`
- emitted at 2 sites
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L148)

Docblock: string email, string reason. (the emitter passes 3 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `token` | `$token` | not declared |
| 2 | `reason` | `$reason` | `string` |
| 3 | `ip_address` | `$ipAddress` | not declared |

When it fires (2 sites)

-   [`ResetPasswordController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/ResetPasswordController.php#L113)[`PUT /api/user/auth/reset-password`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-reset-password)
-   [`ResetPasswordController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/ResetPasswordController.php#L135)[`PUT /api/user/auth/reset-password`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-reset-password)

```php
$event->on(AuthEvent::onAuthPasswordResetFailed(), function ($token, $reason, $ipAddress): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:password:reset:failed ' . json_encode(['reason' => $reason]));
});
```

## `AuthEvent::onAuthRegisterSuccess()`

- Name: `featherpanel:auth:register:success`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L52)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |

When it fires (1 site)

-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L389)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)

```php
$event->on(AuthEvent::onAuthRegisterSuccess(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:register:success ' . json_encode(['user' => $user]));
});
```

## `AuthEvent::onAuthRegistrationFailed()`

- Name: `featherpanel:auth:registration:failed`
- emitted at 7 sites
- 2 payload shapes
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L140)

Docblock: string email, string reason. (the emitter passes 4 values, see the table)

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `email` | `$email` | not declared |
| 2 | `username` | `$username` | not declared |
| 3 | `reason` | `$reason` | `string` |
| 4 | `ip_address` | `$ipAddress` | not declared |

| Arguments passed | Emitted from |
| --- | --- |
| `email`, `username`, `reason`, `ip_address` | 
`RegisterController::put`

`RegisterController::put`

`RegisterController::put`

`RegisterController::put`

`RegisterController::put`

`RegisterController::put`

 |
| `email`, `username`, `reason`, `ip_address`, `abuse_confidence_score` | 

`RegisterController::put`

 |

When it fires (7 sites)

-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L158)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L182)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L199)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L217)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L236)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L254)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)
-   [`RegisterController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/RegisterController.php#L298)[`PUT /api/user/auth/register`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-register)

```php
$event->on(AuthEvent::onAuthRegistrationFailed(), function ($email, $username, $reason, $ipAddress, ...$rest): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:registration:failed ' . json_encode(['reason' => $reason]));
});
```

## `AuthEvent::onAuthResetPasswordSuccess()`

- Name: `featherpanel:auth:reset:password:success`
- emitted at 1 site
- Cancel or modify: no
- [definition](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Plugins/Events/Events/AuthEvent.php#L68)

Docblock: array user info.

| # | Payload key | Listener parameter | Type |
| --- | --- | --- | --- |
| 1 | `user` | `$user` | `array`from docblock |

When it fires (1 site)

-   [`ResetPasswordController::put`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/User/Auth/ResetPasswordController.php#L168)[`PUT /api/user/auth/reset-password`](https://featherpanel.com/docs/api/reference/user/auth/#put-user-auth-reset-password)

```php
$event->on(AuthEvent::onAuthResetPasswordSuccess(), function ($user): void {
    App::getInstance(true)->getLogger()->info('[myplugin] featherpanel:auth:reset:password:success ' . json_encode(['user' => $user]));
});
```
