Hi,
checkHash method under security class takes 25-30ms. Is it Ok?
private function _checkUser( Request $request ) {
$username = $request->getQuery( 'username' );
$password = $request->getQuery( 'password' );
//Check username and password
$user = Users::findFirst( array(
"username='$username'",
"cache" => array( "key" => "users-cache", "lifetime" => 20 )
) );
if ( $user ) {
if ( $this->security->checkHash( $password, $user->password ) ) {
return true;
}else {
return false;
}
}
else {
return false;
}
}
Without checkHash it takes only 4 ms.
Please suggest.
Thanks & Regards Tapan Thapa