fix authentication (login, logout, refresh)