# |
Dec 10th 2019, 09:34 |
gianmarxgagliardi |
sorry |
# |
Dec 10th 2019, 09:34 |
gianmarxgagliardi |
win 10 |
# |
Dec 10th 2019, 09:33 |
jotpe |
Maybe it's only composer, i don't know about your system |
# |
Dec 10th 2019, 09:33 |
gianmarxgagliardi |
I went to the project folder which I called "testlogin" and gave it that command |
# |
Dec 10th 2019, 09:32 |
gianmarxgagliardi |
`Could not open input file: composer.phar` |
# |
Dec 10th 2019, 09:31 |
jotpe |
yes, to the folder, where your composer.json file is. You need to add the plugin as a dependency to composer https://en.wikipedia.org/wiki/Composer_(software) |
# |
Dec 10th 2019, 09:30 |
gianmarxgagliardi |
I go to my project folder and put `php composer.phar require cakephp/authentication`? |
# |
Dec 10th 2019, 09:28 |
jotpe |
via command line in your root folder |
# |
Dec 10th 2019, 09:27 |
jotpe |
you need to do something like this: `php composer.phar require cakephp/authentication` |
# |
Dec 10th 2019, 09:25 |
gianmarxgagliardi |
yes I noticed I deleted line 34 and now it gives me: *`Fatal error: Interface 'Authentication\AuthenticationServiceProviderInterface' not found in C:\wamp64\www\testlogin\src\Application.php on line _35_`* |
# |
Dec 10th 2019, 09:25 |
jotpe |
`*class* Application *extends* BaseApplication` `*class* Application *extends* BaseApplication implements AuthenticationServiceProviderInterface` this doesn't make much sense |
# |
Dec 10th 2019, 09:24 |
gianmarxgagliardi |
I'm sorry I'm not understanding |
# |
Dec 10th 2019, 09:22 |
gianmarxgagliardi |
:,'( |
# |
Dec 10th 2019, 09:21 |
challgren |
*raises hand* I know I know! |
# |
Dec 10th 2019, 09:21 |
jotpe |
Well...that's obvious? :) |
# |
Dec 10th 2019, 09:20 |
gianmarxgagliardi |
https://pastebin.com/wxsNmFD9 |
# |
Dec 10th 2019, 09:19 |
jotpe |
Paste it in a pastebin or github gitst plz |
# |
Dec 10th 2019, 09:19 |
jotpe |
So what's in line 35? |
# |
Dec 10th 2019, 09:19 |
gianmarxgagliardi |
I made a copy and paste of the Application.php file |
# |
Dec 10th 2019, 09:18 |
gianmarxgagliardi |
@jotpe give me this *`( ! ) Parse error: syntax error, unexpected 'class' (T_CLASS), expecting '{' in C:\wamp64\www\testlogin\src\Application.php on line _35_`* |
# |
Dec 10th 2019, 09:14 |
jotpe |
https://book.cakephp.org/3/en/development/application.html |
# |
Dec 10th 2019, 09:14 |
jotpe |
src/Application.php |
# |
Dec 10th 2019, 09:13 |
gianmarxgagliardi |
@jotpe |
# |
Dec 10th 2019, 09:11 |
gianmarxgagliardi |
nameCmsCake>vendor>composer>composer>src>ComposerConsole>Application.php ? |
# |
Dec 10th 2019, 09:09 |
gianmarxgagliardi |
Application.php where I find it ? |
# |
Dec 10th 2019, 09:08 |
gianmarxgagliardi |
where I find that file in the cake structure |
# |
Dec 10th 2019, 09:08 |
gianmarxgagliardi |
I didn't understand how I implement it |
# |
Dec 10th 2019, 09:04 |
jotpe |
@gianmarxgagliardi `$this->Auth->identify();` uses the AuthComponent `$this->Authentication->getResult();` the Middleware of the Authentication Plugin. You need to implement the AuthenticationService in your `Application.php` as in this commit https://github.com/julianpollmann/cakephp-auth/commit/9dbc3ac7d83c7be078e1579d1e9b9f94cf313717 |
# |
Dec 10th 2019, 09:01 |
jotpe |
Morning! |
# |
Dec 10th 2019, 08:38 |
slackebot2 |
`getResult()` on boolean_ |
# |
Dec 10th 2019, 08:38 |
slackebot2 |
login function of your project ``` public function login() { $result = $this->Authentication->getResult(); // If the user is logged in send them away. if ($result->isValid()) { $this->Flash->success(__('You are logged in.')); $target = $this->Authentication->getLoginRedirect() ?? '/users'; return $this->redirect($target); } }``` error: _Call to a member function |
# |
Dec 10th 2019, 08:38 |
gianmarxgagliardi |
the login function of the tutorial 3.8.5 ``` public function login() { if ($this->request->is('post')) { $user = $this->Auth->identify(); if ($user->isValid()){ $this->Auth->setUser($user); return $this->redirect($this->Auth->redirectUrl()); } $this->Flash->error('Your username or password is incorrect.'); } }``` the |
# |
Dec 10th 2019, 08:35 |
gianmarxgagliardi |
@jotpe I saw the project that you shared with what I did from me, there are no big differences are the same. One of the differences is in the login function in the UsersController. Only the login function of the project gives me an error |
# |
Dec 10th 2019, 08:12 |
gianmarxgagliardi |
morning |
# |
Dec 10th 2019, 08:11 |
javier.villanueva |
morning all |
# |
Dec 10th 2019, 01:05 |
kgb.acct.personal |
Uhm. Thanks |
# |
Dec 10th 2019, 01:03 |
slackebot2 |
!tias |
# |
Dec 10th 2019, 01:03 |
slackebot2 |
Command sent from Slack by challgren: |
# |
Dec 10th 2019, 01:01 |
slackebot2 |
!tsia |
# |
Dec 10th 2019, 01:01 |
slackebot2 |
Command sent from Slack by kgb.acct.personal: |
# |
Dec 10th 2019, 00:17 |
dereuromark |
remove that command, you dont need that line |