> For the complete documentation index, see [llms.txt](https://cherrycake.tin.cat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cherrycake.tin.cat/version-0.x/reference/core-modules/login.md).

# Login

> See the [Login guide](/version-0.x/guide/login-guide.md) to learn how to work with the Login module.

## Configuration

* **`userClassName`** The name of the app class that represents a user on the App. Must implement the `\Cherrycake\LoginUser` interface.
* **`passwordAuthenticationMethod`** One of the available `LOGIN_PASSWORD_ENCRYPTION_METHOD_?`constants for password authentication methods. Default:`LOGIN_PASSWORD_ENCRYPTION_METHOD_PBKDF2`
* **`isLoadUserOnInit`** Whether to check for a logged user and get it on this module's init sequence. Default: `true`
* **`sleepOnErrorSeconds`** Seconds to delay execution when a wrong login is requested, to make things difficult for bombing attacks. Default: `1`

## Constants

* `LOGIN_PASSWORD_ENCRYPTION_METHOD_PBKDF2`
* `LOGIN_RESULT_OK`
* `LOGIN_RESULT_FAILED`
* `LOGIN_RESULT_FAILED_UNKNOWN_USER`
* `LOGIN_RESULT_FAILED_WRONG_PASSWORD`
* `LOGOUT_RESULT_OK`
* `LOGOUT_RESULT_FAILED`
