Added graceful handling of http error when swapping token. Now goes to login.