ntfy/web/src/app/Session.js
Philipp Heckel 2772a38dae WIPWIPWIP
2022-12-02 15:37:48 -05:00

22 lines
443 B
JavaScript

class Session {
store(username, token) {
localStorage.setItem("user", username);
localStorage.setItem("token", token);
}
reset() {
localStorage.removeItem("user");
localStorage.removeItem("token");
}
username() {
return localStorage.getItem("user");
}
token() {
return localStorage.getItem("token");
}
}
const session = new Session();
export default session;