Added an authentication method in user model.

The login form now authenticates users.