# |
May 12th 2021, 16:20 |
ndm |
That would be a new request, so the information is gone after a redirect, unless you'd use an authenticator that can identify the user on every request (the session authenticator can be configured to do so), however that identifier could be different to the one used for the initial login. If you need the information from the initial login, then you need to store it yourself so that it is shared across requests (for example in the |
# |
May 12th 2021, 16:08 |
kushan |
I'm trying to get the identifier value in beforeRender(), that is after redirect |
# |
May 12th 2021, 15:52 |
ndm |
Where in your code and when exactly do you try to obtain that value? Note that it will only work in the same request where the user has been identified. |
# |
May 12th 2021, 15:48 |
steinkel |
that's SecurityComponent complaining about a POST being done, debug request data to check it's actually there... |
# |
May 12th 2021, 15:48 |
kushan |
could someone help me please? this is re. Authenticators.. I tried to get the identifier that identified the user similar to what described here https://book.cakephp.org/authentication/2/en/authenticators.html#getting-the-successful-authenticator-or-identifier but $service->getIdentificationProvider() returns null always. Users can login successfully. I am using Password and Ldap identifiers. thanks in advance. |
# |
May 12th 2021, 15:28 |
thomas078 |
got it! |
# |
May 12th 2021, 15:28 |
ndm |
That's how it's ment to work. Debug mode gives you more details to aid with development, production mode gives you less details to minimize exposing information that may make your application vulnerable to the outside world. |
# |
May 12th 2021, 15:18 |
thomas078 |
When i have debug on, authorization plugin gives correct error:Identity is not authorized to perform. When i set debug false, i get 404 error. Dont understand how debug affects error reporting |
# |
May 12th 2021, 13:33 |
neon1024 |
Apologies for being a pain, but what is this? `_Token was not found in request data.` I can see a hidden `_Token` field with debug token, fields token and such |
# |
May 12th 2021, 11:31 |
neon1024 |
Knowing Cake, I’m sure one of the Army of Marks will have updated it by now :,) |
# |
May 12th 2021, 11:30 |
ndm |
Oh and that, yeah |
# |
May 12th 2021, 11:30 |
ndm |
Yeah, it should probably say `FormProtector` component |
# |
May 12th 2021, 11:30 |
neon1024 |
It’s `FormProtectionComponent` |
# |
May 12th 2021, 11:30 |
neon1024 |
Urk, that PR has a typo |
# |
May 12th 2021, 11:29 |
neon1024 |
Seems my afternoon has a twist! |
# |
May 12th 2021, 11:29 |
neon1024 |
> Error Create the class FormProtectorComponent below in file: src/Controller/Component/FormProtectorComponent.php |
# |
May 12th 2021, 11:29 |
neon1024 |
:,) |
# |
May 12th 2021, 11:27 |
neon1024 |
Awesome! :clap: |
# |
May 12th 2021, 11:27 |
ndm |
The message has been improved recently. https://github.com/cakephp/cakephp/pull/15502/files |
# |
May 12th 2021, 11:26 |
neon1024 |
I wonder if the friendsofcake/bootstrap-ui form helper and crud support this properly :thinking_face: |
# |
May 12th 2021, 11:25 |
neon1024 |
It’s not a very helpful exception message to my brain. As my form does have create first :thinking_face: |
# |
May 12th 2021, 11:24 |
neon1024 |
Ah we meet again Mr Bond :raised_hands: |
# |
May 12th 2021, 08:48 |
neon1024 |
Just a random thought, but is it possible to have the router cast integer id values into `int` instead of passing them to my controller methods as `string` ? `function index(string $id){ ` seems a bit odd to me when I am using strict types. Or is this more of a job for a custom router class I’d create? |
# |
May 12th 2021, 08:34 |
erwane |
i always get fresh data in AppController::beforeFilter(). SQL queries are very fast and this prevent any "why it's not updated ??" |
# |
May 12th 2021, 08:20 |
hello106 |
Ah found it `_$this_->Authentication->setIdentity($user);` - couldn’t see that in the main docs anywhere, except within the migration notes (https://book.cakephp.org/authentication/2/en/migration-from-the-authcomponent.html) |
# |
May 12th 2021, 08:14 |
hello106 |
Hi all, could anyone guide me on how you can/should update an identity with newer data (using the Authentication plugin) if say a user update their name/avatar in their profile? We’re using the standard Identity object (https://book.cakephp.org/authentication/2/en/identity-object.html) - thanks |
# |
May 12th 2021, 08:08 |
naresh.thakur1987 |
I tried both ways |
# |
May 12th 2021, 08:08 |
admad |
Your are calling a non https url from a page with https. |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
the code is replica |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
I am facing issue on the this sub domain |
# |
May 12th 2021, 08:07 |
naresh.thakur1987 |
on the another sub domain I don't have ssl and it works perfect. |
# |
May 12th 2021, 08:04 |
conehead |
And this does not happen if you do not use ssl? |
# |
May 12th 2021, 08:02 |
naresh.thakur1987 |
```Warning (2): exif_imagetype(http://inventory.dondoca.com/img/products/140-0-thumbnail.jpg): failed to open stream: Connection timed out [APP/Controller/Component/ImageComponent.php, line 16]``` |
# |
May 12th 2021, 08:01 |
conehead |
What is your issue? You should be able to use SSL without any changes |
# |
May 12th 2021, 07:56 |
naresh.thakur1987 |
Hello All, How to use SSL with CakePHP4. I am facing issue. Can somebody guid me to some document for this? |
# |
May 11th 2021, 21:52 |
ndm |
Might be helpful if _someone_ looks into it some day, having a helpful exception being thrown in case of such a conflicting contain config (assuming it's not a bug) might be nice to have... but yeah, it's probably not going to be me, my todo list is already veeeery long :upside_down_face: |
# |
May 11th 2021, 21:46 |
djinn.vsl |
haha yeah, I know... so I might be lucky not encountering this first. BTW, I made a type (not important) `Measures` is not associated with `Complaints` Since I already made the changes and you told me is a good idea to have different names, I'll leave it this way. If you wan't to dig into the ORM, to see if this can be an improvement it's nice but don't worry about me since you already helped :) |
# |
May 11th 2021, 21:40 |
ndm |
Also, the 3+ ORM is a totally different beast to whatever 2.x was doing, you can't compare their quirks, the 3+ ORM is to the 2.x ORM, what sulfur breathing, winged 10 feet Mars goblins are to the human race ;) |
# |
May 11th 2021, 21:29 |
ndm |
It's probably got to do with the nested users being handled by a separate eager loader instance. |
# |
May 11th 2021, 21:24 |
slackebot |
right now, I'd have to try to replicate your association setup first and dig through the ORM source. |
# |
May 11th 2021, 21:24 |
ndm |
Well, the associations are not the same, `Complaints` is `hasOne`, and `Measures` is `hasMany`, the latter type of association is being retrieved in a separate query, so that probably explains the difference in behavior, as the nested users related config and stuff wont clash with other identical association names for the same query. What exactly makes the `belongsToMany` users affect the `hasOne > belongsTo` users, I can't tell |