@thzero/library_client_firebase 0.16.6 → 0.16.8
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/boot/starter.js +63 -64
- package/package.json +3 -3
package/boot/starter.js
CHANGED
|
@@ -9,9 +9,7 @@ import GlobalUtility from '@thzero/library_client/utility/global';
|
|
|
9
9
|
import config from 'local-config';
|
|
10
10
|
|
|
11
11
|
// export default async ({
|
|
12
|
-
export default ({
|
|
13
|
-
router
|
|
14
|
-
}) => {
|
|
12
|
+
export default (setup) => {
|
|
15
13
|
const configExternal = config.external;
|
|
16
14
|
if (!configExternal)
|
|
17
15
|
throw Error('Invalid external config.');
|
|
@@ -90,67 +88,68 @@ export default ({
|
|
|
90
88
|
// }
|
|
91
89
|
// })
|
|
92
90
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
91
|
+
setup();
|
|
92
|
+
// router.beforeResolve((to, from, next) => {
|
|
93
|
+
// const auth = GlobalUtility.$injector.getService(LibraryConstants.InjectorKeys.SERVICE_AUTH);
|
|
94
|
+
// const logger = GlobalUtility.$injector.getService(LibraryConstants.InjectorKeys.SERVICE_LOGGER);
|
|
95
|
+
// logger.debug('router.beforeResolve', to);
|
|
96
|
+
// if (to.matched.some(record => record.meta.requiresAuth)) {
|
|
97
|
+
// const isLoggedIn = auth.isAuthenticated;
|
|
98
|
+
// if (!isLoggedIn) {
|
|
99
|
+
// // GlobalUtility.$EventBus.on('auth-refresh', (user) => {
|
|
100
|
+
// // logger.debug('auth-refresh', user)
|
|
101
|
+
// // next()
|
|
102
|
+
// // })
|
|
103
|
+
// // return
|
|
104
|
+
// GlobalUtility.$navRouter.push('/', null, () => {
|
|
105
|
+
// // GlobalUtility.$navRouter.push('/')
|
|
106
|
+
// // window.location.href = '/'
|
|
107
|
+
// });
|
|
108
|
+
// return;
|
|
109
|
+
// }
|
|
110
|
+
|
|
111
|
+
// next();
|
|
112
|
+
|
|
113
|
+
// // eslint-disable-next-line no-unused-vars
|
|
114
|
+
// // auth.isAuthenticated().then(async (data) => {
|
|
115
|
+
// // logger.debug('router.beforeResolve.matched')
|
|
116
|
+
|
|
117
|
+
// // //const isLoggedIn = GlobalUtility.$store.state.user.isLoggedIn
|
|
118
|
+
// // const isLoggedIn = await auth.isAuthenticated()
|
|
119
|
+
// // if (!isLoggedIn) {
|
|
120
|
+
// // GlobalUtility.$EventBus.on('auth-refresh', (user) => {
|
|
121
|
+
// // logger.debug('auth-refresh', user)
|
|
122
|
+
// // next()
|
|
123
|
+
// // })
|
|
124
|
+
// // return
|
|
125
|
+
// // }
|
|
126
|
+
|
|
127
|
+
// // // if (GlobalUtility.$store.state.user.token) {
|
|
128
|
+
// // // next()
|
|
129
|
+
// // // return
|
|
130
|
+
// // // }
|
|
131
|
+
|
|
132
|
+
// // // GlobalUtility.$EventBus.on('auth-refresh', (user) => {
|
|
133
|
+
// // // logger.debug('auth-refresh', user)
|
|
134
|
+
// // // next()
|
|
135
|
+
// // // })
|
|
136
|
+
|
|
137
|
+
// // next()
|
|
138
|
+
// // }).catch((e) => {
|
|
139
|
+
// // logger.error('router.beforeResolve.error', e)
|
|
140
|
+
// // logger.error('to', to)
|
|
141
|
+
// // logger.error('from', from)
|
|
142
|
+
// // if (to.name == 'auth') {
|
|
143
|
+
// // next()
|
|
144
|
+
// // return
|
|
145
|
+
// // }
|
|
146
|
+
// // next({ path: '/auth' })
|
|
147
|
+
// // })
|
|
148
|
+
|
|
149
|
+
// return;
|
|
150
|
+
// }
|
|
151
|
+
// next();
|
|
152
|
+
// });
|
|
154
153
|
|
|
155
154
|
return promiseAuth;
|
|
156
155
|
};
|
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.8",
|
|
4
4
|
"version_major": 0,
|
|
5
5
|
"version_minor": 16,
|
|
6
|
-
"version_patch":
|
|
7
|
-
"version_date": "
|
|
6
|
+
"version_patch": 8,
|
|
7
|
+
"version_date": "12/06/2022",
|
|
8
8
|
"author": "thZero",
|
|
9
9
|
"license": "MIT",
|
|
10
10
|
"repository": {
|