2 title = "Username-based Login"
3 author = "@ssddanbrown"
4 date = 2022-11-25T20:00:00Z
5 updated = 2024-10-08T11:00:00Z
9 This is a hack to BookStack, using the theme system, so that login presents itself as a username.
10 Upon login attempt, this will match to a user of `<username>@<configured-domain>` within the database.
14 - This assumes all users in your BookStack instance shares the same email domain.
15 - This overrides a large part of the login form so be extra aware this will be overriding any default changes to BookStack upon updates.
16 - Login page errors may still reference email address, and username will not be auto prefilled after failed login submission.
17 - Other functionality within BookStack can still require or use email, so it's generally a good idea to ensure the resulting email addresses would be valid, or email is disabled at a system level in some manner.
21 - Change the `$emailDomain` variable on line 8 of `functions.php` to be the common email domain used in your BookStack instance (This will be auto-appended to usernames on login).
25 {{<hack file="functions.php" type="logical">}}
27 {{<hack file="auth/parts/login-form-standard.blade.php" type="visual">}}