cronapp-framework-mobile-js 3.0.0-SP.4 → 3.0.0-SP.40
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/components/crn-input-floating.components.json +5 -0
- package/css/app_2.9.css +21 -0
- package/css/themes/custom/cosmo/custom-cosmo.css +84 -13
- package/css/themes/custom/cyborg/custom-cyborg.css +26 -22
- package/css/themes/custom/krypton/custom-krypton.css +366 -339
- package/css/themes/custom/material-round/custom-material-round.css +118 -56
- package/dist/css/app_2.9.css +1 -1
- package/dist/css/themes/custom/cosmo/custom-cosmo.css +1 -1
- package/dist/css/themes/custom/cyborg/custom-cyborg.css +1 -1
- package/dist/css/themes/custom/krypton/custom-krypton.css +1 -1
- package/dist/css/themes/custom/material-round/custom-material-round.css +1 -1
- package/dist/js/app.authentication.js +1 -1
- package/dist/js/app.js +1 -1
- package/dist/js/controllers.authentication.js +1 -1
- package/dist/js/upload.service.js +1 -1
- package/js/app.authentication.js +8 -4
- package/js/app.js +4 -2
- package/js/controllers.authentication.js +7 -1
- package/js/upload.service.js +7 -4
- package/package.json +1 -1
package/js/app.authentication.js
CHANGED
|
@@ -87,10 +87,11 @@ var app = (function() {
|
|
|
87
87
|
function ($q, $rootScope, $injector) {
|
|
88
88
|
var service = {
|
|
89
89
|
request: function (config) {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
if (!window.isUsingCookie()) {
|
|
91
|
+
var _u = JSON.parse(localStorage.getItem('_u'));
|
|
92
|
+
if (_u && _u.token) {
|
|
93
|
+
config.headers['X-AUTH-TOKEN'] = _u.token;
|
|
94
|
+
}
|
|
94
95
|
}
|
|
95
96
|
return config;
|
|
96
97
|
},
|
|
@@ -591,6 +592,9 @@ window.refreshToken = function(Notification, $http, success, err) {
|
|
|
591
592
|
}).success(function (data, status, headers, config) {
|
|
592
593
|
// Store data response on local storage
|
|
593
594
|
console.log('revive :', new Date(data.expires));
|
|
595
|
+
if (window.isUsingCookie()) {
|
|
596
|
+
delete data.token;
|
|
597
|
+
}
|
|
594
598
|
localStorage.setItem("_u", JSON.stringify(data));
|
|
595
599
|
// Recussive
|
|
596
600
|
setTimeout(function () {
|
package/js/app.js
CHANGED
|
@@ -60,8 +60,10 @@ var app = (function() {
|
|
|
60
60
|
function($q, $rootScope) {
|
|
61
61
|
var service = {
|
|
62
62
|
'request': function(config) {
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
if (!window.isUsingCookie()) {
|
|
64
|
+
var _u = JSON.parse(sessionStorage.getItem('_u'));
|
|
65
|
+
if (_u && _u.token) config.headers['X-AUTH-TOKEN'] = _u.token;
|
|
66
|
+
}
|
|
65
67
|
return config;
|
|
66
68
|
}
|
|
67
69
|
};
|
|
@@ -92,6 +92,9 @@
|
|
|
92
92
|
if ($cookies.get('_u')) {
|
|
93
93
|
if (!localStorage.getItem('_u')) {
|
|
94
94
|
var decodedUser = decodeURIComponent($cookies.get('_u'));
|
|
95
|
+
if (window.isUsingCookie()) {
|
|
96
|
+
delete decodedUser.token;
|
|
97
|
+
}
|
|
95
98
|
localStorage.setItem("_u", decodedUser);
|
|
96
99
|
}
|
|
97
100
|
// Redirect to home page
|
|
@@ -113,7 +116,7 @@
|
|
|
113
116
|
'Content-Type' : 'application/x-www-form-urlencoded'
|
|
114
117
|
};
|
|
115
118
|
|
|
116
|
-
if (token) {
|
|
119
|
+
if (!window.isUsingCookie() && token) {
|
|
117
120
|
headerValues["X-AUTH-TOKEN"] = token;
|
|
118
121
|
}
|
|
119
122
|
|
|
@@ -140,6 +143,9 @@
|
|
|
140
143
|
// The session storage will be cleaned when the browser window is closed
|
|
141
144
|
if(typeof (Storage) !== "undefined") {
|
|
142
145
|
// save the user data on localStorage
|
|
146
|
+
if (window.isUsingCookie()) {
|
|
147
|
+
delete data.token;
|
|
148
|
+
}
|
|
143
149
|
localStorage.setItem('_u', JSON.stringify(data));
|
|
144
150
|
}
|
|
145
151
|
else {
|
package/js/upload.service.js
CHANGED
|
@@ -126,14 +126,17 @@
|
|
|
126
126
|
formData.append("file", files[i]);
|
|
127
127
|
}
|
|
128
128
|
let _u = JSON.parse(localStorage.getItem('_u'));
|
|
129
|
+
let headerValues = window.isUsingCookie() ? {
|
|
130
|
+
'Content-Type' : undefined
|
|
131
|
+
} : {
|
|
132
|
+
'Content-Type' : undefined,
|
|
133
|
+
'X-AUTH-TOKEN' : (_u ?_u.token : '')
|
|
134
|
+
};
|
|
129
135
|
this.$promise = $http({
|
|
130
136
|
method: 'POST',
|
|
131
137
|
url: (window.hostApp || "") + uploadUrl,
|
|
132
138
|
data: formData,
|
|
133
|
-
headers:
|
|
134
|
-
'Content-Type': undefined,
|
|
135
|
-
'X-AUTH-TOKEN': (_u ? _u.token : '')
|
|
136
|
-
},
|
|
139
|
+
headers: headerValues,
|
|
137
140
|
onProgress: function (event) {
|
|
138
141
|
this.safeApply(function () {
|
|
139
142
|
if (event.lengthComputable) {
|