Ciao Luciano,
the decode is very simple
first, you need to "split" the string with the "." character
then Base64 Decode and......
eyJhbGci0iJIUzI1NiIsInR5cCI6IkpXVCJ9 = {"alg""HS256","typ":"JWT"}
eyJ0b2tlbl90eXBlIjoicmVmcmVzaCIsImV4cCI6M
TY5MjQ4MjQ1MCwiaWF0IjoxNjkyMzk2MDUwLCJq
dGki0iJkZTg20TcyMzEwOWE0MzBmYjI4YjIxODR
hZWNlODY3ZiIsInVzZXJfaWQi0jh9 = {"token_type":"refresh","exp":1692482450,"iat":1692396050,"jti""de86723109a430fb28b2184aece867f","user_id"8}
then with the first and second part of base64 datas, you need to execute a HMAC-SHA-256 and check it
I think that you don't need a library