]> juplo.de Git - demos/angular/stored-login/commit
fix: `auth.service` reacted inconsistently to `username` changes master
authorKai Moritz <kai@juplo.de>
Tue, 16 Sep 2025 18:51:40 +0000 (20:51 +0200)
committerKai Moritz <kai@juplo.de>
Tue, 16 Sep 2025 19:39:49 +0000 (21:39 +0200)
commit0d8083099a09e18e11f625edd0c45fa774e6a313
tree6f7fda27f6b95a76611e5b2964538eebe8b0361a
parent14fbcc324e8f67bf78bbcc2186e8884779038ef4
fix: `auth.service` reacted inconsistently to `username` changes

* The subscription for `error` is not required, because the subscription for
  `username` is also triggered, when the username is reset after an error.
* The `login` function must not manipulate the local variable `username`
  at all.
* The separate logic in the app-components's init-hook, that redirects
  to the login page, when the user is not yet known, is no longer
  necessary, since the routing can also be triggered in the subscription
  for `username`.
src/app/app.component.ts
src/app/services/auth.service.ts