we're getting a bit cascady here, what about

```
if (res.status === "failed") {
  return navigator.idSSO.logout();
}
if (res.user.username !== displayName) {
  return navigator.idSSO.logout();
}
// login succeeded, show this user as logged in
...
```