@thzero/library_client_firebase 0.14.8 → 0.14.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +6 -6
  2. package/service/index.js +3 -3
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@thzero/library_client_firebase",
3
- "version": "0.14.8",
3
+ "version": "0.14.13",
4
4
  "version_major": 0,
5
5
  "version_minor": 14,
6
- "version_patch": 8,
7
- "version_date": "09/02/2021",
6
+ "version_patch": 13,
7
+ "version_date": "10/02/2021",
8
8
  "author": "thZero",
9
9
  "license": "MIT",
10
10
  "repository": {
@@ -21,11 +21,11 @@
21
21
  "test": "echo \"Error: no test specified\" && exit 1"
22
22
  },
23
23
  "dependencies": {
24
- "firebase": "^9.0.1",
24
+ "firebase": "^9.1.1",
25
25
  "@thzero/library_client": "^0.14",
26
- "@thzero/library_common": "^0.13"
26
+ "@thzero/library_common": "^0.14"
27
27
  },
28
28
  "devDependencies": {
29
- "@thzero/library_cli": "^0.13.17"
29
+ "@thzero/library_cli": "^0.13.19"
30
30
  }
31
31
  }
package/service/index.js CHANGED
@@ -46,7 +46,7 @@ class FirebaseAuthService extends UserAuthService {
46
46
  }
47
47
 
48
48
  get isAuthenticated() {
49
- const user = this.user;
49
+ const user = getAuth().currentUser;
50
50
  this._logger.debug('FirebaseAuthService', 'isAuthenticated', 'user', user);
51
51
  return user != null;
52
52
  }
@@ -213,7 +213,7 @@ class FirebaseAuthService extends UserAuthService {
213
213
  const diff = expired.diff(now);
214
214
  const min = 5 * 60 * 1000;
215
215
  if (diff <= min) {
216
- await this.refreshToken(correlationId, this.user, true).then();
216
+ await this.refreshToken(correlationId, getAuth().currentUser, true).then();
217
217
  return;
218
218
  }
219
219
 
@@ -262,7 +262,7 @@ class FirebaseAuthService extends UserAuthService {
262
262
  await this.refreshToken(correlationId, user);
263
263
  const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USER);
264
264
  const response = await service.updateExternal(correlationId, user);
265
- if (response && response.success) {
265
+ if (this._hasFailed(response)) {
266
266
  await this._serviceUser.setUser(correlationId, response.results);
267
267
  await this._serviceUser.setLoggedIn(correlationId, true);
268
268
  }