Probably important to note in your pseudocode, all parts should be base64url encoded, not just…
Matt Reyer

Good catch Mr. Reyer, thank you very much for pointing that out.

I looked up the official IETF doc on JWT myself to confirm your claim, here is the link for reference:

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.