|
3 | 3 | use Leaf\Helpers\Password; |
4 | 4 |
|
5 | 5 | return [ |
6 | | - // automatically add created_at/updated_at timestamps? |
| 6 | + /* |
| 7 | + |-------------------------------------------------------------------------- |
| 8 | + | Generate timestamps |
| 9 | + |-------------------------------------------------------------------------- |
| 10 | + | |
| 11 | + | Automatically generate created_at/updated_at timestamps for register |
| 12 | + | and update methods |
| 13 | + | |
| 14 | + */ |
7 | 15 | "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. |
| 16 | + |
| 17 | + /* |
| 18 | + |-------------------------------------------------------------------------- |
| 19 | + | Encode password |
| 20 | + |-------------------------------------------------------------------------- |
| 21 | + | |
| 22 | + | Password encode is run when leaf wants to encode passwords on register |
| 23 | + | This exact method is used by default in Leaf, so you can delete it if |
| 24 | + | you want to. |
| 25 | + | |
| 26 | + */ |
11 | 27 | "PASSWORD_ENCODE" => function ($password) { |
12 | 28 | return Password::hash($password); |
13 | 29 | }, |
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. |
| 30 | + |
| 31 | + /* |
| 32 | + |-------------------------------------------------------------------------- |
| 33 | + | Verify Password |
| 34 | + |-------------------------------------------------------------------------- |
| 35 | + | |
| 36 | + | this function is run to verify the password. It's done by default, |
| 37 | + | so you can remove/set this and the above lines null if you wish to. |
| 38 | + | |
| 39 | + */ |
16 | 40 | "PASSWORD_VERIFY" => function ($password, $hashedPassword) { |
17 | 41 | // Inside the password_verify method, you have access to the password and the hashed password |
18 | 42 | return Password::verify($password, $hashedPassword); |
19 | 43 | }, |
20 | | - // the default password key |
| 44 | + |
| 45 | + /* |
| 46 | + |-------------------------------------------------------------------------- |
| 47 | + | Password Key |
| 48 | + |-------------------------------------------------------------------------- |
| 49 | + | |
| 50 | + | the default password key |
| 51 | + | |
| 52 | + */ |
21 | 53 | "PASSWORD_KEY" => "password", |
22 | | - // Hide id field from user object? |
| 54 | + |
| 55 | + /* |
| 56 | + |-------------------------------------------------------------------------- |
| 57 | + | Hide id |
| 58 | + |-------------------------------------------------------------------------- |
| 59 | + | |
| 60 | + | Hide id field from user object? |
| 61 | + | |
| 62 | + */ |
23 | 63 | "HIDE_ID" => true, |
24 | | - // Hide password field from user object? |
| 64 | + |
| 65 | + /* |
| 66 | + |-------------------------------------------------------------------------- |
| 67 | + | Hide password |
| 68 | + |-------------------------------------------------------------------------- |
| 69 | + | |
| 70 | + | Hide user password field |
| 71 | + | |
| 72 | + */ |
25 | 73 | "HIDE_PASSWORD" => true, |
26 | | - // Login params error |
| 74 | + |
| 75 | + /* |
| 76 | + |-------------------------------------------------------------------------- |
| 77 | + | Login params error |
| 78 | + | |
| 79 | + */ |
27 | 80 | "LOGIN_PARAMS_ERROR" => "Username not registered!", |
28 | | - // Login password error |
| 81 | + |
| 82 | + /* |
| 83 | + |-------------------------------------------------------------------------- |
| 84 | + | Login password error |
| 85 | + | |
| 86 | + */ |
29 | 87 | "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. |
| 88 | + |
| 89 | + /* |
| 90 | + |-------------------------------------------------------------------------- |
| 91 | + | Use session [EXPERIMENTAL] |
| 92 | + |-------------------------------------------------------------------------- |
| 93 | + | |
| 94 | + | Use session based authentication instead of the default JWT based auth. |
| 95 | + | |
| 96 | + | If you encounter any problems using any new auth session features, |
| 97 | + | revert to the default auth and manage sessions manually. |
| 98 | + | Don't forget to open an issue. |
| 99 | + | |
| 100 | + */ |
34 | 101 | "USE_SESSION" => false, |
| 102 | + |
| 103 | + /* |
| 104 | + |-------------------------------------------------------------------------- |
| 105 | + | Template Engine [EXPERIMENTAL] |
| 106 | + |-------------------------------------------------------------------------- |
| 107 | + | |
| 108 | + | Leaf MVC unlike other frameworks tries to give you as much control as |
| 109 | + | you need. As such, you can decide which view engine to use. |
| 110 | + | |
| 111 | + */ |
35 | 112 | // Create a session on registration? |
36 | 113 | "SESSION_ON_REGISTER" => false, |
37 | | - // Login page |
| 114 | + |
| 115 | + /* |
| 116 | + |-------------------------------------------------------------------------- |
| 117 | + | Login page route |
| 118 | + | |
| 119 | + */ |
38 | 120 | "GUARD_LOGIN" => "/auth/login", |
39 | | - // Register page |
| 121 | + |
| 122 | + /* |
| 123 | + |-------------------------------------------------------------------------- |
| 124 | + | Rehgister page route |
| 125 | + | |
| 126 | + */ |
40 | 127 | "GUARD_REGISTER" => "/auth/register", |
41 | | - // Logout route |
| 128 | + |
| 129 | + /* |
| 130 | + |-------------------------------------------------------------------------- |
| 131 | + | Logout route |
| 132 | + | |
| 133 | + */ |
42 | 134 | "GUARD_LOGOUT" => "/auth/logout", |
43 | | - // Home page |
| 135 | + |
| 136 | + /* |
| 137 | + |-------------------------------------------------------------------------- |
| 138 | + | Home page route |
| 139 | + | |
| 140 | + */ |
44 | 141 | "GUARD_HOME" => "/home", |
45 | | - // Add an auth token to the auth session? |
| 142 | + |
| 143 | + /* |
| 144 | + |-------------------------------------------------------------------------- |
| 145 | + | JWT + Session |
| 146 | + |-------------------------------------------------------------------------- |
| 147 | + | |
| 148 | + | Add an auth token to the auth session? |
| 149 | + | |
| 150 | + */ |
46 | 151 | "SAVE_SESSION_JWT" => false, |
47 | 152 | ]; |
0 commit comments