Log message #4261079

# At Username Text
# Apr 11th 2021, 13:56 kevin.pfeifer well then its probably neither the apps, nor cakephps fault but rather the devs machine/environment ,:)
# Apr 11th 2021, 13:56 noel The app does though. It’s working on one dev’s machine from the App but not from another dev’s machine.
# Apr 11th 2021, 13:53 kevin.pfeifer per default (not in an API setting) there is a PHPSESSIONID Cookie set which is matched with the authenticated identity. So after you log in and you access some restricted page it check if the given session token (from the Cookie) is currently authenticated. So if your app doesn't "save" the state but postman does I guess postman keeps cookies and your app doesn't?
# Apr 11th 2021, 13:51 noel I’m getting a scenario where I login successfully – get the success message from Auth plugin, but if I then send a request to see if I’m logged in it says “nope, you’re not logged in”… only happens in the app. From POSTMAN it works as expected.
# Apr 11th 2021, 13:49 noel So how does Authentication track whether or not you are logged in? I mean what happens once it authenticates you? How does it know you are now authenticated for the session. Is there some sort of flag somewhere or what?
# Apr 11th 2021, 13:47 kevin.pfeifer dont know if its exactly your problem but i guess at least related
# Apr 11th 2021, 13:40 kevin.pfeifer i rember ndm talked about something similar there
# Apr 11th 2021, 13:35 noel Is there another way to send a login request from POSTMAN that will trigger this route? Currently it’s only triggered by the `.json` suffix if sending from POSTMAN, otherwise from the app itself it doesn’t seem to require the `.json` suffix.
# Apr 11th 2021, 13:34 noel In my routes I have this: ```$routes->setExtensions(['json']); $routes->post('/people/login', ['controller' => 'People', 'action' => 'login']);```
# Apr 11th 2021, 13:32 slackebot because otherwise I can’t test it from POSTMAN, as for it to recognise the route from POSTMAN it seems to need the `.json` suffix.
# Apr 11th 2021, 13:32 noel I guess it’s coming from Application.php ```$service->loadAuthenticator('Authentication.Form', [ 'fields' => $fields, 'loginUrl' => Router::url([ 'prefix' => 'Api', 'plugin' => null, 'controller' => 'People', 'action' => 'login', ]), ]);``` So the question is, how can I set it to also accept ‘.json’? This is necessary
# Apr 11th 2021, 13:28 slackebot somewhere or what?
# Apr 11th 2021, 13:28 noel Hi all. I’m getting this error with authentication: ```Authentication\Authenticator\Result Object ( [_status:protected] => FAILURE_OTHER [_data:protected] => [_errors:protected] => Array ( [0] => Login URL `http://mnr-be.test:8888/api/people/login.json` did not match `/api/people/login`. ) )``` Any idea what’s causing that? I.e. why is this match expected – is that a setting
# Apr 10th 2021, 19:09 me1367 Well... I don't do unit testing myself because I'm too lazy to :P But that's bad practice and I don't recommend it :^)
# Apr 10th 2021, 18:09 minhduc.xd.93 I mean good practices about testing :))
# Apr 10th 2021, 18:09 minhduc.xd.93 I wonder if you have any opinion about testing php codes?
# Apr 10th 2021, 18:05 minhduc.xd.93 thank you ^^
# Apr 10th 2021, 15:57 cnizzardini that would be the better way, i assume i did not
# Apr 10th 2021, 15:56 kevin.pfeifer well if you generated the plugin via the Cake CLI this should be set automatically :thinking_face:
# Apr 10th 2021, 15:54 cnizzardini clearly my issues are from not RTFM
# Apr 10th 2021, 15:53 cnizzardini i clear cache as part of CI/CD so I rarely (if ever) see issues. On local debug mode takes care of it.
# Apr 10th 2021, 15:52 kevin.pfeifer i never run into any model cache problems to be honest. Composer cache only when some module install/update went wrong, but that also is very occasional
# Apr 10th 2021, 15:51 greg138 Browser cache, model cache, Composer cache...
# Apr 10th 2021, 15:50 kevin.pfeifer depends on which level of cache? Most of the issues my customers run into are related to browser cache :,)
# Apr 10th 2021, 15:50 greg138 What percentage of CakePHP-related issues are resolved by clearing a cache? (Not a complaint, just an observation...)
# Apr 10th 2021, 15:49 cnizzardini This really helped to automate installation in this docker-entryscript I am working on
# Apr 10th 2021, 15:48 kevin.pfeifer and you are welcome @cnizzardini
# Apr 10th 2021, 15:48 kevin.pfeifer haha ok thats why, thanks @ndm :)
# Apr 10th 2021, 15:46 cnizzardini thats beer worthy imo
# Apr 10th 2021, 15:45 cnizzardini Figured it was something weird like that, I went ahead and made the change and it worked. Thanks @kevin.pfeifer
# Apr 10th 2021, 15:41 ndm @kevin.pfeifer It's cached locally in `vendor/composer/installed.json`
# Apr 10th 2021, 15:37 cnizzardini i'll try
# Apr 10th 2021, 15:36 kevin.pfeifer as you can see here if the cakephp/plugin-installer checks for that https://github.com/cakephp/plugin-installer/blob/master/src/Plugin.php#L94
# Apr 10th 2021, 15:34 kevin.pfeifer i don’t know why composer still says its a `library` even though i changed it locally to `"type": "cakephp-plugin",` but I think thats the main problem
# Apr 10th 2021, 15:28 cnizzardini still gonna create an issue for that find tho, thanks
# Apr 10th 2021, 15:26 kevin.pfeifer lets continue
# Apr 10th 2021, 15:26 kevin.pfeifer mhmm ok no still not present
# Apr 10th 2021, 15:25 kevin.pfeifer otherwhise the generator skips it
# Apr 10th 2021, 15:25 kevin.pfeifer you need to set `"type": "cakephp-plugin",` in your composer.json
# Apr 10th 2021, 15:25 kevin.pfeifer i think i got it
# Apr 10th 2021, 15:25 kevin.pfeifer haha