{"size": 484, "ext": "js", "max_stars_repo_path": "src/utils/auth.js", "max_stars_repo_name": "dollarkillerx/fireworks_front_end", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/utils/auth.js", "max_issues_repo_name": "dollarkillerx/fireworks_front_end", "max_issues_repo_issues_event_min_datetime": "2022-03-30T09:01:06.000Z", "max_issues_repo_issues_event_max_datetime": "2022-03-30T09:02:21.000Z", "max_forks_repo_path": "src/utils/auth.js", "max_forks_repo_name": "dollarkillerx/fireworks_front_end", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": 19, "max_forks_count": null, "avg_line_length": 20.1666666667, "max_line_length": 57, "alphanum_fraction": 0.729338843}
export function getToken() {
  return localStorage.AuthToken
}

export function getJWT() {
  let tks = localStorage.AuthToken.split(".");
  return JSON.parse(Base64decode(tks[1]));
}

export function setToken(token) {
  localStorage.setItem("AuthToken", token)


  localStorage.setItem("UserName", getJWT().payload.name)
}

export function removeToken() {
  localStorage.removeItem("AuthToken")
}

function Base64decode(str) {
  return Buffer.from(str, 'base64').toString('ascii');
}
