SAP-BTP-Spielwiese/app1/node_modules/validator/es/lib/isJWT.js
Markus Rettig 775ac7b58c completed step 3 from the tutorial
you must login with an BTP account in order to see the app
2024-02-08 16:13:36 +01:00

17 lines
No EOL
387 B
JavaScript

import assertString from './util/assertString';
import isBase64 from './isBase64';
export default function isJWT(str) {
assertString(str);
var dotSplit = str.split('.');
var len = dotSplit.length;
if (len > 3 || len < 2) {
return false;
}
return dotSplit.reduce(function (acc, currElem) {
return acc && isBase64(currElem, {
urlSafe: true
});
}, true);
}