{"size": 665, "ext": "js", "max_stars_repo_path": "src/services/auth.js", "max_stars_repo_name": "LA-Music/lamusic-frontend", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "src/services/auth.js", "max_issues_repo_name": "LA-Music/lamusic-frontend", "max_issues_repo_issues_event_min_datetime": "2022-02-10T22:06:11.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T22:06:11.000Z", "max_forks_repo_path": "src/services/auth.js", "max_forks_repo_name": "LA-Music/lamusic-frontend", "max_forks_repo_forks_event_min_datetime": "2021-03-24T12:24:53.000Z", "max_forks_repo_forks_event_max_datetime": "2021-03-24T12:24:53.000Z"}
{"max_stars_count": null, "max_issues_count": 1, "max_forks_count": 1, "avg_line_length": 33.25, "max_line_length": 69, "alphanum_fraction": 0.7172932331}
import Cookies from 'js-cookie';
export const TOKEN_KEY = "lamusic-Token";
export const EMAIL_KEY = "lamusic-email";
export const isAuthenticated = () => Cookies.get(TOKEN_KEY) !== null;
export const getToken = () => Cookies.get(TOKEN_KEY);
export const getEmail = () => Cookies.get(EMAIL_KEY);
export const login = (token, email) => {
  // localStorage.setItem(TOKEN_KEY, token);
  // localStorage.setItem(EMAIL_KEY, email);
  Cookies.set(TOKEN_KEY, token)
  Cookies.set(EMAIL_KEY, email)

};
export const logout = () => {
  Cookies.remove(TOKEN_KEY)
  Cookies.remove(EMAIL_KEY)
  // localStorage.removeItem(TOKEN_KEY);
  // localStorage.removeItem(EMAIL_KEY);
};
