Updated auth.php to return json type.