# |
Apr 26th 2021, 20:10 |
kevin.pfeifer |
yop |
# |
Apr 26th 2021, 20:09 |
greg138 |
Oh wait, in classes? Like `<p class="blah">`? |
# |
Apr 26th 2021, 20:08 |
greg138 |
`h()`? |
# |
Apr 26th 2021, 19:40 |
kevin.pfeifer |
or should i just write my own :) |
# |
Apr 26th 2021, 19:40 |
kevin.pfeifer |
is there a “built in” View Helper which lets me sanitize strings to be used in HTML classes? |
# |
Apr 26th 2021, 16:33 |
ndm |
After 8 rounds of voting It would probably look like `<(![ProgressHelper]!)>$io->helper('Progress')` :troll: |
# |
Apr 26th 2021, 16:32 |
ndm |
Maybe in a few years we get language level typecasts. |
# |
Apr 26th 2021, 16:31 |
ndm |
Well, the base class certainly doesn't satisfy that type, so that's where an inline hint would be required, being it an ignore, or a type hint. Not sure if PhpStan maybe has a tag for typehinting method return values by now. |
# |
Apr 26th 2021, 16:29 |
neon1024 |
Nevermind, thanks for looking :) |
# |
Apr 26th 2021, 16:28 |
neon1024 |
The load method inside returns mixed too, so unsure |
# |
Apr 26th 2021, 16:27 |
neon1024 |
I thought it allowed child classes, but I guess I was wrong |
# |
Apr 26th 2021, 16:26 |
neon1024 |
I can add a line ignore, it’s only a utility :) |
# |
Apr 26th 2021, 16:26 |
neon1024 |
Unfortunately it’s a catch 22 |
# |
Apr 26th 2021, 16:23 |
ndm |
Type as the concrete implementation ie `ProgresssHelper` |
# |
Apr 26th 2021, 16:23 |
ndm |
Using the base class is the opposite of what I ment :) |
# |
Apr 26th 2021, 16:20 |
neon1024 |
Just using the base class might work I guess if I ignore the errors |
# |
Apr 26th 2021, 16:20 |
tyler.adam.lazenby |
and my browser doesn't 100% like my certificate |
# |
Apr 26th 2021, 16:19 |
tyler.adam.lazenby |
oof ok the reaons was because I had set it to secure and httponly as true |
# |
Apr 26th 2021, 16:19 |
tyler.adam.lazenby |
Well that did set the expires to something else and the cookie is there, BUUUUUT I am still getting logged out as soon as the session ends. |
# |
Apr 26th 2021, 16:18 |
ndm |
Every helper is a `\Cake\Console\Helper`, but not every `\Cake\Console\Helper` is a `\Cake\Shell\Helper\ProgressHelper`. Drop the base class reference. |
# |
Apr 26th 2021, 16:17 |
neon1024 |
It cannot be sidestepped either `* @var \Cake\Shell\Helper\ProgressHelper|\Cake\Console\Helper` :x: |
# |
Apr 26th 2021, 16:17 |
neon1024 |
Perhaps the ProgressHelper is only for Shells? ..and not Commands? :thinking_face: |
# |
Apr 26th 2021, 16:15 |
neon1024 |
Anyone else have an issue in 3.x with `$io->helper('Progress')` having an `@return \Cake\Console\Helper` which makes PHP Stan angry, because it’s not an instance of `\Cake\Shell\Helper\ProgressHelper` is there supposed to be a mismatch between `\Console` and `\Shell` ?? |
# |
Apr 26th 2021, 16:15 |
kevin.pfeifer |
thats at least whats in cakedc/user default values is set https://github.com/CakeDC/users/blob/master/config/users.php#L95 |
# |
Apr 26th 2021, 16:14 |
kevin.pfeifer |
try `'expires' => new \DateTime('+1 month'),` |
# |
Apr 26th 2021, 16:13 |
ndm |
What "what" might be? |
# |
Apr 26th 2021, 16:13 |
tyler.adam.lazenby |
maybe every quarter |
# |
Apr 26th 2021, 16:13 |
tyler.adam.lazenby |
I don't want my users having to log in every month |
# |
Apr 26th 2021, 16:12 |
tyler.adam.lazenby |
do you have a suggestion what that might be? I am thinking maybe once ever few years... |
# |
Apr 26th 2021, 16:08 |
ndm |
Set an actual expiration, `null` means client default, which is until session ends. |
# |
Apr 26th 2021, 16:05 |
tyler.adam.lazenby |
Am I supposed to add anything to UsersController::login? |
# |
Apr 26th 2021, 15:54 |
tyler.adam.lazenby |
so I am confused |
# |
Apr 26th 2021, 15:54 |
tyler.adam.lazenby |
But the default for the cookie.expires is null |
# |
Apr 26th 2021, 15:54 |
tyler.adam.lazenby |
I noticed when I inspect the cookie, that the expire is set to expire when the session ends |
# |
Apr 26th 2021, 15:53 |
tyler.adam.lazenby |
I wish it was that easy |
# |
Apr 26th 2021, 15:53 |
greg138 |
That would have been an obvious and easy fix. :( |
# |
Apr 26th 2021, 15:53 |
tyler.adam.lazenby |
Nope |
# |
Apr 26th 2021, 15:53 |
greg138 |
You're not browsing in private / incognito mode, are you? |
# |
Apr 26th 2021, 15:49 |
tyler.adam.lazenby |
don't mind the notes, that was from a previous version |
# |
Apr 26th 2021, 15:49 |
slackebot |
'urlChecker' => DefaultUrlChecker::class, 'loginUrl' => $loginUrl, 'passwordHasher' => DefaultPasswordHasher::class ]);``` |
# |
Apr 26th 2021, 15:49 |
slackebot |
'fields' => $fields, 'loginUrl' => $loginUrl, ]); $service->loadAuthenticator('Authentication.Session'); $service->loadAuthenticator('Authentication.Cookie', [ 'rememberMeField' => 'remember_me', 'cookie' => [ 'name' => 'CookieAuth', 'expires' => null, 'path' => '/', 'domain' => '', 'secure' => false, 'httponly' => false, 'value' => '', ], 'fields' => $fields, |