Skip to content

Commit 005ef54

Browse files
author
Bernardo-MG
committed
renamed field
1 parent c7328df commit 005ef54

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/app/core/authentication/services/security-container.service.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,19 +18,19 @@ export class SecurityContainer {
1818
/**
1919
* Subject with the user status.
2020
*/
21-
private userSubject: BehaviorSubject<SecurityStatus>;
21+
private statusSubject: BehaviorSubject<SecurityStatus>;
2222

2323
constructor(
2424
) {
25-
this.userSubject = this.readUserFromLocal();
25+
this.statusSubject = this.readStatusFromLocal();
2626
}
2727

2828
/**
2929
* Clears out the authentication status. In practice this will log out the user in session.
3030
*/
3131
public reset() {
3232
// Replace local data with empty user status
33-
this.userSubject.next(new SecurityStatus());
33+
this.statusSubject.next(new SecurityStatus());
3434

3535
// Clear local storage
3636
localStorage.removeItem(this.userKey);
@@ -41,7 +41,7 @@ export class SecurityContainer {
4141
* @returns the user currently in session
4242
*/
4343
public getStatus(): SecurityStatus {
44-
return this.userSubject.value;
44+
return this.statusSubject.value;
4545
}
4646

4747
/**
@@ -50,7 +50,7 @@ export class SecurityContainer {
5050
* @returns the user status for the user currently in session as an observable
5151
*/
5252
public getStatusObservable(): Observable<SecurityStatus> {
53-
return this.userSubject.asObservable();
53+
return this.statusSubject.asObservable();
5454
}
5555

5656
/**
@@ -60,7 +60,7 @@ export class SecurityContainer {
6060
* @param user user status to store
6161
*/
6262
public setStatus(user: SecurityStatus, rememberMe: boolean) {
63-
this.userSubject.next(user);
63+
this.statusSubject.next(user);
6464

6565
if (rememberMe) {
6666
// Store user status in the local storage
@@ -79,7 +79,7 @@ export class SecurityContainer {
7979
*
8080
* @returns the user stored in the local storage as part of the 'remember me'
8181
*/
82-
private readUserFromLocal(): BehaviorSubject<SecurityStatus> {
82+
private readStatusFromLocal(): BehaviorSubject<SecurityStatus> {
8383
let subject: BehaviorSubject<SecurityStatus>;
8484

8585
// If the user was stored, load it

0 commit comments

Comments
 (0)