CodeIgniter 4 User Login Tutorial - Part 3 - User Login & Session

preview_player
Показать описание
In this video we continue to build a User Login system using CodeIgniter 4. This is a Part 3 of the series where we will complete:
- User login logic
- Create custom validation rule
- Validate user through custom form validation rule

You can get full code from GitHub:
Рекомендации по теме
Комментарии
Автор

I love this video and the content . I'll go subscribe and turn notification so i can get notif if you publish another video. Keep the great work man. Good luck.

witfproject
Автор

Hi, Thanks for the great tutorial. I am getting error

is not a valid rule.
at line 10

How to fix ? I have check and I have typed everything same as yours but your is working and I get error!!!

tapanbhanot
Автор

hi @Alex Lancer,
in your Route.php :
$routes->get('/', 'Users::index');
this is not work for me, I change to :
$routes->match(['get', 'post'], '/', 'Users::index')
and it's works for me.
Is that right ?
Please comment, thank you.

fuchandraxing
Автор

Hey Alex! Great tutorial so far. I am having an issue at 11:05 where I am presented with a "The email field is required.
The password field is required." instead of "Email or password don't match". I continued through and added the password_verify line to UserRules.php but I am still presented with "The email field is required.
The password field is required." even though they are both supplied and correct. Any suggestions?

penguinstyles
Автор

Alex - Great tutorial! 
I have a problem with picking up the custom css for the error messages on Login/Registration forms. I am adding the following to the head section (right under the bootstrap link) of Views/templates/header.php file: <link rel="stylesheet" there is a file by that name in that location, but I can't seem to access the styles. Any thoughts?

windy
Автор

Hi Alex, I discovered something interesting. In your video you outputted errors to view by using $data['validation'] = $this->validator; that way the whole validation object gets passed to view with all the rules and stuff. It might be much leaner by passing just the error array by doing $data['errors'] = Then In the view you can traverse through $errors array of key value pairs.

jigglypotatoes
Автор

Hi alex, every time I try to log in with credential right or wrong I get the message 404 and it tells me that "Can't find route for 'post: /.' I checked your code in github and it was exactly the same, do you know why tjis happens?

gonzalo
Автор

i already followed your tutorial, but everytime i clicked that login button, it enters anyway even with random data (random username and password)

aqsalardiana
Автор

Hi Alex, Thank you for giving this very useful tutorial. but I found a problem with validateUser[email, password] which shows a mismatch. is this a problem with UserModel or UserRules? even though I've often compared your code.

dengannama
Автор

hi sir, i followed your tutorial. how do you set default localhost in codeigniter? i am using like this localhost:8080/users because of its i cannot redirect to next page after submit. it send next page like localhost/users

sivasankari
Автор

help! i have an error "Call to undefined function set_value() " everytime I login.

coleenjaemoralidad
Автор

Hi Alex, I see you face an error on the line 33 because of the $model->model() whereas it should be $model->where() which I am not sure why did you only get the error now and not when you test the login function earlier. I should have just continued watching the whole video instead of spending 2 days to debug that issue. After I fixed it then I realized you had that error. omg

Xvqier
Автор

Hi Alex, When I put the data correctly to login, I keep getting the validation error(Email or Password don't match).

sebastianramirez
Автор

Excelente Axel... la libreria Shopping Cart, no esta disponible en esta version? Sabes si existe alguna posibilidad de integrarla? Gracias

AntonioVillordo
Автор

Hi Thanks for great video but password verify function not returning anything..its always says that not match...am stuck here please help

mrandmrsbhatia
Автор

a great thank you to you for this help

sandeepkumarr
Автор

I was wondering and a little bit confused, you use CodeIgniter/Model in the model file but don't use CodeIgniter/Controller in the controller file. So what's the difference if using CodeIgniter/Controller instead to not using it? isn't that important?

itsRekx
Автор

Hey hie Alex, I just want to validate session for all controllers. How can I do with CI4?
Plz guide

siddheshkadam
Автор

Hi! First, I want to thank you for what are you doing on your channel. It helps me, but now I have a problem with validateUser method, even if the password is correct, the form is not valid because the password and email don't mach. Can you please provide me a solution? Thank you in advance!

iulianab
Автор

validateUser function has error which allows incorrect password to is no else statement of " if(!$user) ".

prithvituladhar