Can't decode jwt in add-on

I have add-on that need information about user. I use atob function on client to decode payload of jwt and get it. But when user full name contains next characters: “šić” I get error “Failed to execute ‘atob’ on ‘Window’: The string to be decoded is not correctly encoded”.

Browser: Google Chrome
Version 63.0.3239.132 (Official Build) (64-bit)

I missed that jira feed the JWT to add-on using url parameter and because of that jwt is encoded using url base64 encoding. But atob expects base64 encoded string. It is necessary to replace ‘-’ and ‘_’ to ‘+’ and ‘/’ to fix issue.