Change string test in `̀set_auth_handler` so that it handles unicode and str indifferently