Fix if auth is enabled

Replaced in_array with array_key_exists