|
3 | 3 | use Leaf\Helpers\Password; |
4 | 4 |
|
5 | 5 | return [ |
6 | | - "login" => "/auth/login", |
7 | | - "register" => "/auth/register", |
8 | | - "authenticated" => "/home", |
9 | | - "logout" => "/auth/logout", |
10 | | - "settings" => [ |
11 | | - "USE_TIMESTAMPS" => true, |
12 | | - // Password encode is run when leaf wants to encode passwords on register |
13 | | - // This exact method is used by default in Leaf, so you can delete it if |
14 | | - // you want to. |
15 | | - "PASSWORD_ENCODE" => function ($password) { |
16 | | - return Password::hash($password); |
17 | | - }, |
18 | | - // this function is run to verify the password. It's done by default, |
19 | | - // so you can remove/set this and the above lines null if you wish to. |
20 | | - "PASSWORD_VERIFY" => function ($password, $hashedPassword) { |
21 | | - // Inside the password_verify method, you have access to the password and the hashed password |
22 | | - return Password::verify($password, $hashedPassword); |
23 | | - }, |
24 | | - "PASSWORD_KEY" => "password", |
25 | | - "HIDE_ID" => true, |
26 | | - "HIDE_PASSWORD" => true, |
27 | | - "LOGIN_PARAMS_ERROR" => "Username not registered!", |
28 | | - "LOGIN_PASSWORD_ERROR" => "Password is incorrect!", |
29 | | - // USE_SESSION is experimental and may cause problems for your whole |
30 | | - // authentication. If this happens, revert to the default auth and |
31 | | - // manage sessions manually. |
32 | | - "USE_SESSION" => false, |
33 | | - // Create a session on registration? |
34 | | - "SESSION_ON_REGISTER" => false, |
35 | | - // Login page |
36 | | - "GUARD_LOGIN" => "/auth/login", |
37 | | - // Register page |
38 | | - "GUARD_REGISTER" => "/auth/register", |
39 | | - // Logout route |
40 | | - "GUARD_LOGOUT" => "/auth/logout", |
41 | | - // Home page |
42 | | - "GUARD_HOME" => "/home", |
43 | | - "SAVE_SESSION_JWT" => false, |
44 | | - ], |
| 6 | + // automatically add created_at/updated_at timestamps? |
| 7 | + "USE_TIMESTAMPS" => true, |
| 8 | + // Password encode is run when leaf wants to encode passwords on register |
| 9 | + // This exact method is used by default in Leaf, so you can delete it if |
| 10 | + // you want to. |
| 11 | + "PASSWORD_ENCODE" => function ($password) { |
| 12 | + return Password::hash($password); |
| 13 | + }, |
| 14 | + // this function is run to verify the password. It's done by default, |
| 15 | + // so you can remove/set this and the above lines null if you wish to. |
| 16 | + "PASSWORD_VERIFY" => function ($password, $hashedPassword) { |
| 17 | + // Inside the password_verify method, you have access to the password and the hashed password |
| 18 | + return Password::verify($password, $hashedPassword); |
| 19 | + }, |
| 20 | + // the default password key |
| 21 | + "PASSWORD_KEY" => "password", |
| 22 | + // Hide id field from user object? |
| 23 | + "HIDE_ID" => true, |
| 24 | + // Hide password field from user object? |
| 25 | + "HIDE_PASSWORD" => true, |
| 26 | + // Login params error |
| 27 | + "LOGIN_PARAMS_ERROR" => "Username not registered!", |
| 28 | + // Login password error |
| 29 | + "LOGIN_PASSWORD_ERROR" => "Password is incorrect!", |
| 30 | + // USE_SESSION is experimental!!! |
| 31 | + // If you encounter any problems using any new auth session features, |
| 32 | + // revert to the default auth and manage sessions manually. |
| 33 | + // Don't forget to open an issue. |
| 34 | + "USE_SESSION" => false, |
| 35 | + // Create a session on registration? |
| 36 | + "SESSION_ON_REGISTER" => false, |
| 37 | + // Login page |
| 38 | + "GUARD_LOGIN" => "/auth/login", |
| 39 | + // Register page |
| 40 | + "GUARD_REGISTER" => "/auth/register", |
| 41 | + // Logout route |
| 42 | + "GUARD_LOGOUT" => "/auth/logout", |
| 43 | + // Home page |
| 44 | + "GUARD_HOME" => "/home", |
| 45 | + // Add an auth token to the auth session? |
| 46 | + "SAVE_SESSION_JWT" => false, |
45 | 47 | ]; |
0 commit comments