mirror of
https://github.com/binwiederhier/ntfy.git
synced 2025-06-03 19:58:06 +02:00
No real changes, just renames
This commit is contained in:
parent
4704b2a0e4
commit
2e8292a65f
10 changed files with 31 additions and 35 deletions
web/src/app
|
@ -1,5 +1,9 @@
|
|||
import sessionReplica from "./SessionReplica";
|
||||
|
||||
/**
|
||||
* Manages the logged-in user's session and access token.
|
||||
* The session replica is stored in IndexedDB so that the service worker can access it.
|
||||
*/
|
||||
class Session {
|
||||
constructor(replica) {
|
||||
this.replica = replica;
|
||||
|
@ -8,14 +12,12 @@ class Session {
|
|||
store(username, token) {
|
||||
localStorage.setItem("user", username);
|
||||
localStorage.setItem("token", token);
|
||||
|
||||
this.replica.store(username, token);
|
||||
}
|
||||
|
||||
reset() {
|
||||
localStorage.removeItem("user");
|
||||
localStorage.removeItem("token");
|
||||
|
||||
this.replica.reset();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue