# |
Feb 12th 2020, 15:38 |
dan874 |
Hi all, quick one if im looking to build a feature class is it better to build this as a component so its in the "cake" lifecycle and its aware of it or can i build it as a stand alone class and expect things like `getMockModel` to work. I've basically done the second and it doesnt seem to be working as expected. |
# |
Feb 12th 2020, 15:32 |
dan874 |
afternoon all |
# |
Feb 12th 2020, 15:27 |
neon1024 |
Afternoon everyone! :wave: |
# |
Feb 12th 2020, 15:14 |
damiano |
why authentication plugin queries are not shown in debugkit (sqlog)? |
# |
Feb 12th 2020, 13:58 |
dereuromark |
:) |
# |
Feb 12th 2020, 13:58 |
challgren |
Yeah, I just need to figure out how the hell to use twig |
# |
Feb 12th 2020, 13:58 |
dereuromark |
thought you meant the actual plugin code |
# |
Feb 12th 2020, 13:58 |
dereuromark |
oh, bake.. there you need manually, yeah |
# |
Feb 12th 2020, 13:58 |
challgren |
when baking? |
# |
Feb 12th 2020, 13:58 |
dereuromark |
ideally of course you are always fully up to date here even on plugins :) |
# |
Feb 12th 2020, 13:57 |
dereuromark |
you can use ide helper to add those, with -p PluginName |
# |
Feb 12th 2020, 13:56 |
challgren |
Same that ide-helper would add |
# |
Feb 12th 2020, 13:55 |
damiano |
ok perfect @challgren |
# |
Feb 12th 2020, 13:55 |
dereuromark |
@challgren what kind of? |
# |
Feb 12th 2020, 13:53 |
ndm |
Correct, the `remember_me` field must be present and not empty |
# |
Feb 12th 2020, 13:52 |
ndm |
The order _can_ matter, but it would usually be the other way around, the authenticators that identify you automatically (session, cookie, ...) should go first. |
# |
Feb 12th 2020, 13:51 |
damiano |
@ndm but...for cookie the post data must have "remember_me" field otherwise it will not create the cookie |
# |
Feb 12th 2020, 13:50 |
damiano |
i must add cookie authenticator AFTER for authenticator |
# |
Feb 12th 2020, 13:50 |
damiano |
@ndm ok so the order matter when we add authenticators to the service |
# |
Feb 12th 2020, 13:48 |
ndm |
Most likely not, `beforeFind` is triggered when the query is being executed. You could make it configurable via options that you evaluate in your `beforeFind` handler, or maybe apply it in an overwritten `Table::find()`. |
# |
Feb 12th 2020, 13:45 |
k4t |
when I define some "default" values for query in BeforeFind is it possible to overwrite them somehow during building query in e.g. controller? |
# |
Feb 12th 2020, 13:44 |
challgren |
@dereuromark what you think about adding docblocks to foc/bootstrap-ui? |
# |
Feb 12th 2020, 13:35 |
ndm |
If required it's also possible to trigger that process manually via the authentication component. |
# |
Feb 12th 2020, 13:35 |
ndm |
Persisting is what happens after succesful authentication (unless the authenticator is stateless), once the request returns from the controller layer, the middleware will invoke the persisting process, where authenticators like the session and cookie authenticators will store the identity accordingly. |
# |
Feb 12th 2020, 13:29 |
damiano |
@ndn with "persisted" do you mean when i already have identified the user via Form Authenticator (for example) ? |
# |
Feb 12th 2020, 13:28 |
ndm |
@damiano The cookie is being created automatically when the identity is being persisted |
# |
Feb 12th 2020, 13:14 |
pieceof |
CAKEPHP (cake2) |
# |
Feb 12th 2020, 13:08 |
challgren |
Not sure I dont directly use the new authentication plugins |
# |
Feb 12th 2020, 13:08 |
damiano |
right? |
# |
Feb 12th 2020, 13:08 |
damiano |
already created |
# |
Feb 12th 2020, 13:08 |
damiano |
@challgren i am trying...thanks, however the cookie authentication supposes that there is a cookie names CookieAuth right? |
# |
Feb 12th 2020, 12:55 |
challgren |
Not sure |
# |
Feb 12th 2020, 12:54 |
damiano |
wrong? |
# |
Feb 12th 2020, 12:53 |
damiano |
@challgren i am dealing with cookies because i want to create the remember_me authetication...i have followed the doc, but i miss a part, is the AuthCookie created automatically? it seems not, i first should create the cookie and then cake will "just update" it... |
# |
Feb 12th 2020, 12:52 |
damiano |
it works so,....ok....but maybe am i just lucky? :) |
# |
Feb 12th 2020, 12:52 |
damiano |
and now it works, without returning anything |
# |
Feb 12th 2020, 12:52 |
damiano |
@challgren i do not know if it is a problem or not...but i tried $this->response->withCookie(new Cookie(......); |
# |
Feb 12th 2020, 12:49 |
challgren |
Did you try $this->response = $this->response->withCookie() |
# |
Feb 12th 2020, 12:45 |
damiano |
at the end of the action |
# |
Feb 12th 2020, 12:45 |
damiano |
@ishan hmm wait i do not see the view if i do return $response |
# |
Feb 12th 2020, 12:44 |
damiano |
@ishan i try |