Use prepared statement in authentication

Authentication is now using prepared statements