isJWT function

bool isJWT(
  1. String str
)

Checks if the string is a valid JSON Web Token (JWT).

A JWT consists of three base64url-encoded segments separated by dots. The signature segment may be empty (for unsigned tokens).

Example:

isJWT('eyJhbGci.eyJzdWIi.SflKxwRJ'); // true
isJWT('eyJhbGci.eyJzdWIi'); // false (only two segments)

Implementation

bool isJWT(String str) => _isJWT(str);