# |
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 |
# |
Apr 10th 2021, 15:24 |
cnizzardini |
sheesh |
# |
Apr 10th 2021, 15:24 |
cnizzardini |
maybe it never worked... all the way down to 4.1.6 now |
# |
Apr 10th 2021, 15:22 |
cnizzardini |
Yeah I went back to 4.2.0 to see if a breaking change was introduced but same problem |
# |
Apr 10th 2021, 15:22 |
cnizzardini |
ugh |
# |
Apr 10th 2021, 15:20 |
kevin.pfeifer |
now we have to find out why its not present there but all the other MixerApi Plugins do |