# |
Jul 19th 2017, 12:46 |
Ecorce |
In the second page, that session data is unset (confirmation in debugkit= |
# |
Jul 19th 2017, 12:45 |
Ecorce |
I check in the beforeFilter of the Api/AppController is $this->Auth->user('id') is set. If not, I throw an exception (except for login, obviously). |
# |
Jul 19th 2017, 12:44 |
adriencs |
you have an error ? what it say |
# |
Jul 19th 2017, 12:42 |
adriencs |
yup that's it |
# |
Jul 19th 2017, 12:42 |
adriencs |
something like `App\Controller\Api` |
# |
Jul 19th 2017, 12:42 |
Ecorce |
Yep : namespace App\Controller\Api; (my prefix is "api") |
# |
Jul 19th 2017, 12:41 |
hmic |
correct. and yes, you need to adapt the namespace in the (copied) AppController file to your prefix namespace! |
# |
Jul 19th 2017, 12:40 |
adriencs |
seem correct, what about `namespaces` ? |
# |
Jul 19th 2017, 12:38 |
Ecorce |
my new AppController extends Cake\Controller\Controller (like the initial one), is that correct? |
# |
Jul 19th 2017, 12:32 |
Ecorce |
confirmation : justf after login, there's a "Auth.User" session, then nothing set |
# |
Jul 19th 2017, 12:31 |
Ecorce |
stateless auth? |
# |
Jul 19th 2017, 12:22 |
hmic |
usually it would. but for testing if the prefix works for the first time i think his approach is understandable - copy you current appcontroller and start from there |
# |
Jul 19th 2017, 12:21 |
admad |
shouldn't you API be using stateless auth? :slightly_smiling_face: |
# |
Jul 19th 2017, 12:20 |
hmic |
use debugkit? no: use debugkit! |
# |
Jul 19th 2017, 12:20 |
hmic |
Ecorce, looks like it's not |
# |
Jul 19th 2017, 12:19 |
Ecorce |
Problem is : Auth works on login, but during the next action called, Auth doesn't seem to be loaded ($this->Auth->user('id') returns null, whereas the login was successful) |
# |
Jul 19th 2017, 12:18 |
Ecorce |
Mmm now I have a problem with the Auth Component, which is loaded inside my "prefix" AppController. However, this is the whole copy of the basic AppController, why don't the code work? |
# |
Jul 19th 2017, 12:01 |
neon1024 |
Well if anyone has any ideas, please let me know. Think I’ll eat lunch and delete the test as it doesn’t seem possible |
# |
Jul 19th 2017, 11:58 |
neon1024 |
The query objects `__debugInfo()` can pickup the contains array correctly, but it seems to be restricted to the objects internal scope, as any attempt to retrieve it from the calling scope returns an empty array |
# |
Jul 19th 2017, 11:56 |
neon1024 |
Is anyone able to help me with testing my behaviours beforeFind? I can’t crack it after 1.5 days trying. This is where I’m at, https://pastebin.com/Wgj6G7gQ which fails as the contain array is empty, but the beforeFind callback is being executed |
# |
Jul 19th 2017, 11:50 |
Ecorce |
Wonderful, thanks :) |
# |
Jul 19th 2017, 11:49 |
hmic |
yes. |
# |
Jul 19th 2017, 11:49 |
Ecorce |
so the initial AppController in src/Controller/ won't be executed ? |
# |
Jul 19th 2017, 11:49 |
hmic |
create the file, extend it. done |
# |
Jul 19th 2017, 11:48 |
hmic |
Ecorce, yes. |
# |
Jul 19th 2017, 11:48 |
Ecorce |
- src/Controller/Api/AppController.php |
# |
Jul 19th 2017, 11:48 |
Ecorce |
In Cakephp 3.x, can a prefix folder get its own AppController, like this : |
# |
Jul 19th 2017, 11:48 |
neon1024 |
Anyone know how to get the contained associations from a query object? I’ve tried `$query->contain()` `$query->getEagerLoader()->contain()` |
# |
Jul 19th 2017, 11:47 |
VersadrillCanada |
hi |
# |
Jul 19th 2017, 11:47 |
Ecorce |
Hello everyone |
# |
Jul 19th 2017, 11:34 |
cakephp869 |
I'd like to insert directly in db |
# |
Jul 19th 2017, 11:33 |
cakephp869 |
how cake calculate the password? |
# |
Jul 19th 2017, 11:33 |
cakephp869 |
now I have to insert a huge list of user |
# |
Jul 19th 2017, 11:33 |
cakephp869 |
but now yes |
# |
Jul 19th 2017, 11:33 |
adriencs |
Cake 2 ? |
# |
Jul 19th 2017, 11:32 |
cakephp869 |
when I insert a user in my app I use AuthComponent::password to save an hash passord in DB |
# |
Jul 19th 2017, 11:32 |
cakephp869 |
I have to insert a list of users |
# |
Jul 19th 2017, 11:32 |
cakephp869 |
hi all |
# |
Jul 19th 2017, 11:16 |
adriencs |
can you set a remote Datasource in app.php ? |
# |
Jul 19th 2017, 11:04 |
neon1024 |
`1) ExitLinks\Tests\Model\Behavior\GoodbyeBehaviorTest::testBeforeFindContain Cake\Database\Exception: Cannot describe articles. It has 0 columns.` |
# |
Jul 19th 2017, 11:04 |
neon1024 |
Well converting from MySQL to SQLite has thrown up an interesting one |