# |
May 11th 2021, 14:41 |
paolo.bragagni |
it fires my authenticate method |
# |
May 11th 2021, 14:41 |
paolo.bragagni |
when I call $this->Authentication->logout(); |
# |
May 11th 2021, 14:33 |
paolo.bragagni |
thanks. probably oauth2 provider need to logout? |
# |
May 11th 2021, 14:28 |
ndm |
So you are probably best off allowing access to the logout. Why your authenticator is re-authenticating on logout (automatically I suppose?), that's not something anyone could really answer, you'd have to show the involved code. |
# |
May 11th 2021, 14:26 |
paolo.bragagni |
so... (??) |
# |
May 11th 2021, 14:26 |
ndm |
Yeah, the consistent response is a good argument, there's not really a need to fail hard on logout. The cleanup thing, I'm not too convinced, as the app's authentication should be able to handle "dirty" data when authenticating, as it cannot expect users do always gracefully logout. |
# |
May 11th 2021, 14:19 |
ndm |
@dereuromark I mean... yeah, maybe. I can't think of how such a partial logout could look like right now, but I'm it's possible :upside_down_face: |
# |
May 11th 2021, 14:15 |
ndm |
@etibor You might be lacking a dedicated `else` branch, hard to say without seeing your complete code. |
# |
May 11th 2021, 14:14 |
paolo.bragagni |
but when I logout in some way it reauthenticate |
# |
May 11th 2021, 14:13 |
paolo.bragagni |
my authenticate function is for oauth2 |
# |
May 11th 2021, 14:12 |
paolo.bragagni |
but I cant get logout work |
# |
May 11th 2021, 14:12 |
paolo.bragagni |
I've build a (probably tremendous) Authenticator and it seems that work |
# |
May 11th 2021, 14:12 |
etibor |
@ndm thank you, its almost good, actually i have two: $this->set('thesises', $this->paginate($documents)) one is inside a post in case of form submit the other is outside of the post, in case of just arrive to the index.ctp now probybly its not properly placed, becuse after the submit, outside of the post $this->set('thesises', $this->paginate($documents)) will be showed |
# |
May 11th 2021, 14:11 |
paolo.bragagni |
hihi you are right |
# |
May 11th 2021, 14:10 |
ndm |
Why would you allow non-authenticated users to log out? |
# |
May 11th 2021, 14:10 |
kevin.pfeifer |
in your controller |
# |
May 11th 2021, 14:09 |
kevin.pfeifer |
``` public function beforeFilter( \Cake\Event\EventInterface $event ) { parent::beforeFilter( $event ); // Configure the login action to not require authentication, preventing // the infinite redirect loop issue $this->Authentication->addUnauthenticatedActions( [ 'login', 'logout' ] ); }``` |
# |
May 11th 2021, 14:08 |
paolo.bragagni |
how can I bypass authenticator (for my logout?) |
# |
May 11th 2021, 14:06 |
ndm |
@etibor You catch that exception, and do whatever you want then, for example redirect to the first page like `return $this->redirect(['?' => ['page' => 1]]);`, see https://book.cakephp.org/4/en/controllers/components/pagination.html#out-of-range-page-requests |
# |
May 11th 2021, 14:00 |
etibor |
i created a form filter in an index.ctp page the issue is that i could not configure to jump to the first page after the submit now if i am at the 20th page(url show ?page=20), and the actual query does not have such as elements its arrive to an error page how can i define here: $this->set('thesises', $this->paginate($documents)) or some other places ? |
# |
May 11th 2021, 13:57 |
etibor |
hello evryone |
# |
May 11th 2021, 12:53 |
etibor |
how did you tried? |
# |
May 11th 2021, 12:07 |
paolo.bragagni |
Cant remove session in logout |
# |
May 11th 2021, 11:42 |
etibor |
from day-to-day there is less activity in the channel |
# |
May 11th 2021, 08:04 |
etibor |
this does not works : $this->request->getQuery('page',NULL); |
# |
May 11th 2021, 07:37 |
etibor |
okey maybe it is: ```$this->request->getQuery('does_not_exist', 'default val');``` |
# |
May 11th 2021, 07:34 |
etibor |
is there a way to set the request param when submit? i have a special case when the id in the url must not be used even it is in i tried somethin similar: $this->request->setParam('id',NULL); |
# |
May 11th 2021, 07:32 |
etibor |
hello evryone |
# |
May 11th 2021, 07:30 |
paolo.bragagni |
If the user is not in my user table, how can I take the uusername that I got in my Oauth2Authenticator and pass it to the register view? |
# |
May 11th 2021, 07:29 |
paolo.bragagni |
I've build my Oauth2Authenticator and it works. I mean if the username is registered in my user table ie authenticate ecc ecc.. |
# |
May 11th 2021, 06:06 |
kevin.pfeifer |
thanks, that was the solution :bow: |
# |
May 11th 2021, 04:08 |
admad |
@tyler.adam.lazenby I hope this is not a public app as you have provided a way to DDOS it by using for e.g. `?limit=99999999` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
yeeeyahhh |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
```histories = $this->Histories->find() ->contain('HistoryTypes') ->where([ 'contact_id' => $refer_params['id'], 'HistoryTypes.name' => $this->request->getQuery('name'), ]) ->limit($this->request->getQuery('limit') ?? 5);``` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
```$referer = $this->referer('/', true); $refer_params = Router::getRouteCollection()->parse($referer);``` |
# |
May 10th 2021, 23:04 |
tyler.adam.lazenby |
Aahhhh figured it out |
# |
May 10th 2021, 22:51 |
rightscoreanalysis |
ah typo :) |
# |
May 10th 2021, 22:49 |
rightscoreanalysis |
they both extend IntegrationsAppMode |
# |
May 10th 2021, 22:49 |
rightscoreanalysis |
I only have one IntegrationsAppModel.php, and User.php and Order.php model files |
# |
May 10th 2021, 22:48 |
rightscoreanalysis |
Cannot declare class IntergrationsAppModel, because the name is already in use |
# |
May 10th 2021, 22:48 |
rightscoreanalysis |
I am creating a plugin for a legacy cake2 project |