@thzero/library_client_firebase 0.16.3 → 0.16.5
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.
- package/README.md +8 -3
- package/package.json +4 -4
- package/service/index.js +5 -5
package/README.md
CHANGED
|
@@ -8,7 +8,14 @@
|
|
|
8
8
|
|
|
9
9
|
[](https://npmjs.org/package/@thzero/library_client_firebase)
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
### Requirements
|
|
12
|
+
|
|
13
|
+
#### Packages
|
|
14
|
+
|
|
15
|
+
* [](https://npmjs.org/package/@thzero/library_common)
|
|
16
|
+
* [](https://npmjs.org/package/@thzero/library_client)
|
|
17
|
+
|
|
18
|
+
## Configuration
|
|
12
19
|
|
|
13
20
|
### Firebase
|
|
14
21
|
|
|
@@ -29,8 +36,6 @@ Google Firebase (https://firebase.google.com) provides the social based authenti
|
|
|
29
36
|
* Enable the Google Analytics.
|
|
30
37
|
* Copy the 'measurementId' key//value pair into the external/firebase config object (below)
|
|
31
38
|
|
|
32
|
-
## Configuration
|
|
33
|
-
|
|
34
39
|
### Application Configuration
|
|
35
40
|
|
|
36
41
|
* In the configuration files (development.json and production.json) of the application
|
package/package.json
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thzero/library_client_firebase",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.5",
|
|
4
4
|
"version_major": 0,
|
|
5
5
|
"version_minor": 16,
|
|
6
|
-
"version_patch":
|
|
7
|
-
"version_date": "11/
|
|
6
|
+
"version_patch": 5,
|
|
7
|
+
"version_date": "11/25/2022",
|
|
8
8
|
"author": "thZero",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"firebase": "^9.
|
|
23
|
+
"firebase": "^9.14.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"@thzero/library_client": "^0.16",
|
package/service/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { getAuth, signInWithPopup, GoogleAuthProvider } from "firebase/auth";
|
|
|
4
4
|
|
|
5
5
|
import LibraryConstants from '@thzero/library_client/constants';
|
|
6
6
|
|
|
7
|
-
import
|
|
7
|
+
import Utility from '@thzero/library_common/utility';
|
|
8
8
|
|
|
9
9
|
import UserAuthService from '@thzero/library_client/service/auth/user';
|
|
10
10
|
|
|
@@ -41,7 +41,7 @@ class FirebaseAuthService extends UserAuthService {
|
|
|
41
41
|
|
|
42
42
|
get externalUser() {
|
|
43
43
|
const user = getAuth().currentUser;
|
|
44
|
-
this._logger.debug('FirebaseAuthService', 'tokenUser', 'user', user,
|
|
44
|
+
this._logger.debug('FirebaseAuthService', 'tokenUser', 'user', user, Utility.generateId());
|
|
45
45
|
return user;
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -52,7 +52,7 @@ class FirebaseAuthService extends UserAuthService {
|
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
async onAuthStateChanged(user) {
|
|
55
|
-
const correlationId =
|
|
55
|
+
const correlationId = Utility.generateId();
|
|
56
56
|
try {
|
|
57
57
|
await this.updateExternalUser(correlationId, user, true);
|
|
58
58
|
// if (!user)
|
|
@@ -208,8 +208,8 @@ class FirebaseAuthService extends UserAuthService {
|
|
|
208
208
|
|
|
209
209
|
this.announceToken(correlationId, user, token);
|
|
210
210
|
|
|
211
|
-
const expired =
|
|
212
|
-
const now =
|
|
211
|
+
const expired = Utility.getDateParse(tokenResult.expirationTime);
|
|
212
|
+
const now = Utility.getDate();
|
|
213
213
|
const diff = expired.diff(now);
|
|
214
214
|
const min = 5 * 60 * 1000;
|
|
215
215
|
if (diff <= min) {
|