6989a98d75
- Arkitektur: docs/auth/passwordless-architecture.md - Backend: iom/quixzoom-auth-service/ (FastAPI + Redis) - Webb: quixzoom-market-pages/se/login/ (QR-kod + polling) - App: iom/quixzoom-app/src/features/auth/ (push + deep links) Flöde: QR-kod → app-godkännande → webb-inloggad
15 lines
376 B
JavaScript
15 lines
376 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) {
|
|
return false;
|
|
}
|
|
return dotSplit.reduce(function (acc, currElem) {
|
|
return acc && isBase64(currElem, {
|
|
urlSafe: true
|
|
});
|
|
}, true);
|
|
} |