Using Cartalys Sentry 2, and I can't seem to find any documentation on the difference between the authenticate() and login() methods, nor when to use one versus the other. Any guidance appreciated.
The difference is that authenticate
will receive an array of credentials:
// Login credentials
$credentials = array(
'email' => '[email protected]',
'password' => 'password',
);
// Authenticate the user
$user = Sentry::authenticate($credentials, false);
And the login
method receives an $user object
// Find the user using the user id
$user = Sentry::findUserById(1);
// Log the user in
Sentry::login($user, false);