Changed how login page works based on user feedback. By default, we have the old login flow when authentication is enabled and in addition, we will auto fill the username based on last login on device. (#621)

This commit is contained in:
Joseph Milazzo 2021-10-02 11:35:38 -07:00 committed by GitHub
parent 34d171f0b4
commit 30a302bf99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 42 additions and 14 deletions

View file

@ -16,6 +16,7 @@ export class AccountService implements OnDestroy {
baseUrl = environment.apiUrl;
userKey = 'kavita-user';
public lastLoginKey = 'kavita-lastlogin';
currentUser: User | undefined;
// Stores values, when someone subscribes gives (1) of last values seen.
@ -70,6 +71,7 @@ export class AccountService implements OnDestroy {
});
localStorage.setItem(this.userKey, JSON.stringify(user));
localStorage.setItem(this.lastLoginKey, user.username);
}
this.currentUserSource.next(user);