Skip to content

Commit

Permalink
✨ Add Web#logout() function
Browse files Browse the repository at this point in the history
  • Loading branch information
47PADO47 committed Aug 13, 2022
1 parent 0280a38 commit 6585b1d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/classes/Web.ts
Expand Up @@ -89,6 +89,24 @@ class Web {
return this.authorized;
}

logout() {
if (!this.authorized) {
this.#error("Already logged out");
return false;
}

this.#token = "";
this.authorized = false;
this.user = {
cid: "",
cognome: "",
nome: "",
id: 0,
type: "",
};
return !this.authorized;
};

async getAgenda(
start: Date = new Date(),
end: Date = new Date(),
Expand Down

0 comments on commit 6585b1d

Please sign in to comment.