-
|
I wanted to login controller with api, but I've been testing for example: current login controller without api$credentials = [
'email' => $this->request->getPost('email'),
'password' => $this->request->getPost('password')
];
$loginAttempt = auth()->attempt($credentials);
if (! $loginAttempt->isOK()) {
return redirect()->back()->with('error', $loginAttempt->reason());
}
return redirect()->to('dashboard');dashboard: for example: customize login controller with api$credentials = [
'email' => $this->request->getPost('email'),
'password' => $this->request->getPost('password')
];
$loginAttempt = auth()->attempt($credentials);
if (! $loginAttempt->isOK()) {
return return $this->respond([
'success' => false
]);
}
return return $this->respond([
'success' => true,
'url' => 'dashboard'
]);dashboard: I have no idea. Why |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
|
How did you check the |
Beta Was this translation helpful? Give feedback.
-
|
@jlopes90 return return !! |
Beta Was this translation helpful? Give feedback.
-
|
I just updated |
Beta Was this translation helpful? Give feedback.
I just updated
codeigniter 4.2.3and theshield developtoo and tested it with api and it's already working.