edit the auth logic