# |
Dec 13th 2017, 09:59 |
joopm |
yes automatically do the auth compenent |
# |
Dec 13th 2017, 09:57 |
hmic |
this has been added to the authcomponent some time ago |
# |
Dec 13th 2017, 09:57 |
hmic |
which cakephp version? |
# |
Dec 13th 2017, 09:57 |
hmic |
does the authcomponent do the redirect automatically? |
# |
Dec 13th 2017, 09:57 |
joopm |
when its logged,and click the content of email immediatly redirect to the desired page |
# |
Dec 13th 2017, 09:56 |
joopm |
i define the url,but because the user is not logged first he has to login |
# |
Dec 13th 2017, 09:55 |
hmic |
joopm, after clicking the link in the mail and beeing redirected to the login page - from the authcomponent, not a custom action in your controller! - can you see the get parameters in the url ?redirect=.... |
# |
Dec 13th 2017, 09:54 |
joopm |
when i use $this->redirect($this->referer()); its "leave" on the login page |
# |
Dec 13th 2017, 09:53 |
LubosR |
hmic, thanks. yes it makes sense :) v1 it is at this case for me :) |
# |
Dec 13th 2017, 09:51 |
hmic |
the authcomponent can do that - and does automatically - since some time |
# |
Dec 13th 2017, 09:51 |
hmic |
joopm, which cake version? |
# |
Dec 13th 2017, 09:51 |
joopm |
so i send the exact link,but he need to login first,now i can not use the |
# |
Dec 13th 2017, 09:51 |
dereuromark |
All works perfectly, email or no email |
# |
Dec 13th 2017, 09:51 |
dereuromark |
I dont get it.. Check this out: http://sandbox.dereuromark.de/auth-sandbox/auth-sandbox/for-all => redirect back after login |
# |
Dec 13th 2017, 09:50 |
joopm |
and no previous i send the exact link in email |
# |
Dec 13th 2017, 09:50 |
dereuromark |
also there you can pass query strings in links in emails |
# |
Dec 13th 2017, 09:50 |
joopm |
okey the scenerio is the user is "coming" from email |
# |
Dec 13th 2017, 09:49 |
joopm |
my cake is 3.5 |
# |
Dec 13th 2017, 09:49 |
hmic |
LubosR, if you want to handle your try/catch blocks in the same way, you might want to use v2 everywhere. in this particular place, i'd not be afraid of using v1 though. |
# |
Dec 13th 2017, 09:49 |
joopm |
hello dereuromark |
# |
Dec 13th 2017, 09:48 |
dereuromark |
joopm: the framework should already do that for you, appending the redirect query string. what version are you on? |
# |
Dec 13th 2017, 09:47 |
neon1024 |
Add the redirect query string to the link |
# |
Dec 13th 2017, 09:47 |
joopm |
how should modify the redirect? |
# |
Dec 13th 2017, 09:46 |
LubosR |
Looks like I am not only one who is not sure :) I have same feelings like you hmic, i like v1, but v2 more versatile :) |
# |
Dec 13th 2017, 09:46 |
joopm |
but in this time no previus page |
# |
Dec 13th 2017, 09:46 |
joopm |
the referer redirect to the previus page |
# |
Dec 13th 2017, 09:46 |
joopm |
but i want that redirect to the same url |
# |
Dec 13th 2017, 09:46 |
joopm |
i having the following issue: i sent an OTP email to a user,when the user click to the link first he need to login |
# |
Dec 13th 2017, 09:45 |
joopm |
hello there |
# |
Dec 13th 2017, 09:39 |
hmic |
and i have been talking about the 2nd case too. |
# |
Dec 13th 2017, 09:38 |
hmic |
you do |
# |
Dec 13th 2017, 09:38 |
saeideng |
and you no need to catch IMO |
# |
Dec 13th 2017, 09:38 |
saeideng |
I means for second style :slightly_smiling_face: |
# |
Dec 13th 2017, 09:37 |
hmic |
saeideng: you don't need that, in the catch case, it will be unset due to the exception |
# |
Dec 13th 2017, 09:36 |
saeideng |
but by default `$project=null` |
# |
Dec 13th 2017, 09:36 |
saeideng |
both is true |
# |
Dec 13th 2017, 09:36 |
hmic |
i'd still say the second version is more "common", it's - theoretically - more versatile at least... but i still like v1 better. in this case it's a very clear codepath |
# |
Dec 13th 2017, 09:35 |
hmic |
LubosR, are you sure the scopes work this way? - at least the $project will not be set when entering the catch... you are setting a value to it, not trying to get anything, so thats ok to me at first sight |
# |
Dec 13th 2017, 09:32 |
LubosR |
I like style v1 (see image) but never used try catch this way so looks bit weird :) |
# |
Dec 13th 2017, 09:31 |
LubosR |
Hey all, I have fundamendal question and it is more about PHP best practices than CakePHP, but still would like to know and I think u can tell. Which style is "correct" https://ibb.co/fyAxN6 |
# |
Dec 13th 2017, 06:09 |
joopm |
dieppk did you use before the $this->loadModel('Modelname') |