Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup #35

Merged
merged 4 commits into from Dec 8, 2020
Merged

Cleanup #35

Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

Next

Remove redundant code for JWT parsing

  • Loading branch information
chrmod committed Dec 8, 2020
commit 662cdfa6ed1a887c6243c1d05048beb47c4428d4
@@ -43,16 +43,6 @@ class AccessToken {
}
}

function parseJwt(token) {
var base64Url = token.split('.')[1];
var base64 = base64Url.replace(/-/g, '+').replace(/_/g, '/');
var jsonPayload = decodeURIComponent(atob(base64).split('').map(function(c) {
return '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2);
}).join(''));

return JSON.parse(jsonPayload);
};

const cookieListener = (changeInfo) => {
const { cookie, removed, cause } = changeInfo;
if (cookie.domain !== AUTH_DOMAIN) {
ProTip! Use n and p to navigate between commits in a pull request.