ru.coon 2.8.3 → 2.8.4

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/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # Version 2.8.4, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/79f9eb3363e07fb47ac3ac23659b94b34c7423b9)
2
+ * TR-69542 fix: восстановление утраченной авторизации по токену. ([402a8a], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/402a8a5e63da1342b44b6e95a7eed96d5b9a42aa))
3
+ * update: CHANGELOG.md ([b11b4c], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/b11b4c53ff53f0dde24c4e017e09046a77609ac4))
4
+
1
5
  # Version 2.8.3, [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f2bd405e3421aa5e65c5c112ce39cd61806e1e09)
2
6
  * update: CHANGELOG.md ([f52e7b], [link](http://gitlab-dbr.sigma-it.local/dbr/ru.coon/-/commit/f52e7b66d3bb410cfe89272d0eccd0632d1c30e3))
3
7
 
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "name": "ru.coon"
5
5
  },
6
6
  "description": "",
7
- "version": "2.8.3",
7
+ "version": "2.8.4",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "git+http://gitlab-dbr.sigma-it.local/dbr/ru.coon"
@@ -196,25 +196,41 @@ Ext.define('Coon.app.Application', {
196
196
  });
197
197
  },
198
198
 
199
-
200
199
  launch: function() {
201
200
  this.appRouter.onBeforeRouteEnterFn = this.isAuthenticated.bind(this);
202
201
  Ext.on('auth:logout', this.onLogout, this);
203
- this.checkAuth().then(() => {
204
- Ext.get('splash').fadeOut({
205
- duration: 1000,
206
- listeners: {
207
- afteranimate: {
208
- fn: this.afterLoad,
209
- single: true,
210
- scope: this,
211
- },
212
- },
202
+ let jwtToken;
203
+ let beforeAuth = () => Promise.resolve();
204
+ if (Ext.isFunction(this.checkJwtAuth)) {
205
+ jwtToken = this.appRouter.getAuthToken();
206
+ if (jwtToken) {
207
+ beforeAuth = this.checkJwtAuth;
208
+ }
209
+ }
210
+
211
+ beforeAuth.call(this, jwtToken)
212
+ .then(this.checkAuth.bind(this))
213
+ .then(() => {
214
+ this.stopAnimation();
215
+ this.afterCheckAuth();
213
216
  });
214
- this.afterCheckAuth();
215
- });
217
+
216
218
  this.afterLaunch();
217
219
  },
220
+
221
+ stopAnimation() {
222
+ Ext.get('splash').fadeOut({
223
+ duration: 1000,
224
+ listeners: {
225
+ afteranimate: {
226
+ fn: this.afterLoad,
227
+ single: true,
228
+ scope: this,
229
+ },
230
+ },
231
+ });
232
+ },
233
+
218
234
  afterAuthorized() {},
219
235
 
220
236
  afterLaunch() {},
package/src/app/Router.js CHANGED
@@ -75,5 +75,14 @@ Ext.define('Coon.app.Router', {
75
75
  const routerView = this.getRouterView();
76
76
  return routerView && routerView.getLayout().getActiveItem();
77
77
  },
78
+ getAuthToken() {
79
+ const search = document.location.search;
80
+ let jwtToken;
81
+ if (Ext.isString(search) && search.includes('?')) {
82
+ const urlParameters = Ext.Object.fromQueryString(search);
83
+ jwtToken = urlParameters.jwtToken;
84
+ }
85
+ return jwtToken;
86
+ },
78
87
 
79
88
  });
package/src/version.js CHANGED
@@ -1,4 +1,4 @@
1
1
  Ext.define('Coon.version', {
2
2
  singleton: true,
3
- number: '2.8.3',
3
+ number: '2.8.4',
4
4
  });