@putkoff/abstract-utilities 0.1.212 → 0.1.213
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/dist/cjs/index.js +6 -9
- package/dist/cjs/index.js.map +1 -1
- package/dist/esm/index.js +6 -9
- package/dist/esm/index.js.map +1 -1
- package/package.json +1 -1
package/dist/esm/index.js
CHANGED
|
@@ -185,16 +185,13 @@ function isTokenExpired(token) {
|
|
|
185
185
|
}
|
|
186
186
|
/** Convenience wrapper: return username from the JWT (or null). */
|
|
187
187
|
function currentUsername() {
|
|
188
|
-
const
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
return username !== null && username !== void 0 ? username : null;
|
|
194
|
-
}
|
|
195
|
-
catch (_a) {
|
|
196
|
-
return null;
|
|
188
|
+
const token = getToken();
|
|
189
|
+
let uName = null;
|
|
190
|
+
if (token) {
|
|
191
|
+
const decodedJwt = decodeJwt(token) || {};
|
|
192
|
+
uName = (decodedJwt === null || decodedJwt === void 0 ? void 0 : decodedJwt.username) || null;
|
|
197
193
|
}
|
|
194
|
+
return uName;
|
|
198
195
|
}
|
|
199
196
|
function currentUsernames() {
|
|
200
197
|
var _a;
|