]> BookStack Code Mirror - hacks/blob - content/username-login/index.md
Merge branch 'main' of github.com:BookStackApp/hacks
[hacks] / content / username-login / index.md
1 +++
2 title = "Username-based Login"
3 author = "@ssddanbrown"
4 date = 2022-11-25T20:00:00Z
5 updated = 2022-11-25T20:00:00Z
6 tested = "v22.10"
7 +++
8
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.
11
12 #### Considerations
13
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
17 #### Options
18
19 - Change the `EMAIL_DOMAIN` variable on line 7 of `functions.php` to be the common email domain used in your BookStack instance.
20
21 #### Code
22
23 {{<hack file="functions.php" type="logical">}}
24
25 {{<hack file="auth/parts/login-form-standard.blade.php" type="visual">}}