Add offline mode and refresh token