|
20 | 20 | |-------------------------------------------------------------------------- |
21 | 21 | | |
22 | 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. |
| 23 | + | This exact method is used by default in Leaf, so you can set it to null |
| 24 | + | if you want to. |
| 25 | + | |
| 26 | + | You can set your own implementation instead of Password::hash |
25 | 27 | | |
26 | 28 | */ |
27 | 29 | "PASSWORD_ENCODE" => function ($password) { |
|
33 | 35 | | Verify Password |
34 | 36 | |-------------------------------------------------------------------------- |
35 | 37 | | |
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 | + | This function is run to verify the password. This implementation is done |
| 39 | + | by default, so you can set it to null, and it will still work fine. |
| 40 | + | |
| 41 | + | You can add your own implementation instead of Password::verify |
38 | 42 | | |
39 | 43 | */ |
40 | 44 | "PASSWORD_VERIFY" => function ($password, $hashedPassword) { |
41 | | - // Inside the password_verify method, you have access to the password and the hashed password |
42 | 45 | return Password::verify($password, $hashedPassword); |
43 | 46 | }, |
44 | 47 |
|
|
47 | 50 | | Password Key |
48 | 51 | |-------------------------------------------------------------------------- |
49 | 52 | | |
50 | | - | the default password key |
| 53 | + | The default password key. Leaf will expect this key to hold passwords |
| 54 | + | in your database. |
51 | 55 | | |
52 | 56 | */ |
53 | 57 | "PASSWORD_KEY" => "password", |
|
57 | 61 | | Hide id |
58 | 62 | |-------------------------------------------------------------------------- |
59 | 63 | | |
60 | | - | Hide id field from user object? |
| 64 | + | Hide id field from user object returned in login, register and update |
61 | 65 | | |
62 | 66 | */ |
63 | 67 | "HIDE_ID" => true, |
|
67 | 71 | | Hide password |
68 | 72 | |-------------------------------------------------------------------------- |
69 | 73 | | |
70 | | - | Hide user password field |
| 74 | + | Hide password from user object returned in login, register and update |
71 | 75 | | |
72 | 76 | */ |
73 | 77 | "HIDE_PASSWORD" => true, |
74 | 78 |
|
75 | 79 | /* |
76 | 80 | |-------------------------------------------------------------------------- |
77 | 81 | | Login params error |
| 82 | + |-------------------------------------------------------------------------- |
| 83 | + | |
| 84 | + | Error to show when the login params aren't found in db |
78 | 85 | | |
79 | 86 | */ |
80 | 87 | "LOGIN_PARAMS_ERROR" => "Username not registered!", |
81 | 88 |
|
82 | 89 | /* |
83 | 90 | |-------------------------------------------------------------------------- |
84 | | - | Login password error |
| 91 | + | Password error |
| 92 | + |-------------------------------------------------------------------------- |
| 93 | + | |
| 94 | + | Error to show when the login password is wrong |
85 | 95 | | |
86 | 96 | */ |
87 | 97 | "LOGIN_PASSWORD_ERROR" => "Password is incorrect!", |
|
102 | 112 |
|
103 | 113 | /* |
104 | 114 | |-------------------------------------------------------------------------- |
105 | | - | Template Engine [EXPERIMENTAL] |
| 115 | + | Session on register |
106 | 116 | |-------------------------------------------------------------------------- |
107 | 117 | | |
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. |
| 118 | + | If true, a session will be created on a successful registration, else |
| 119 | + | you it'll be created on login rather. |
110 | 120 | | |
111 | 121 | */ |
112 | | - // Create a session on registration? |
113 | 122 | "SESSION_ON_REGISTER" => false, |
114 | 123 |
|
115 | 124 | /* |
116 | 125 | |-------------------------------------------------------------------------- |
117 | 126 | | Login page route |
118 | | - | |
| 127 | + |-------------------------------------------------------------------------- |
119 | 128 | */ |
120 | 129 | "GUARD_LOGIN" => "/auth/login", |
121 | 130 |
|
122 | 131 | /* |
123 | 132 | |-------------------------------------------------------------------------- |
124 | | - | Rehgister page route |
125 | | - | |
| 133 | + | Register page route |
| 134 | + |-------------------------------------------------------------------------- |
126 | 135 | */ |
127 | 136 | "GUARD_REGISTER" => "/auth/register", |
128 | 137 |
|
129 | 138 | /* |
130 | 139 | |-------------------------------------------------------------------------- |
131 | 140 | | Logout route |
132 | | - | |
| 141 | + |-------------------------------------------------------------------------- |
133 | 142 | */ |
134 | 143 | "GUARD_LOGOUT" => "/auth/logout", |
135 | 144 |
|
136 | 145 | /* |
137 | 146 | |-------------------------------------------------------------------------- |
138 | 147 | | Home page route |
139 | | - | |
| 148 | + |-------------------------------------------------------------------------- |
140 | 149 | */ |
141 | 150 | "GUARD_HOME" => "/home", |
142 | 151 |
|
|
0 commit comments