1
0
Fork 0
mirror of https://github.com/binwiederhier/ntfy.git synced 2025-06-18 10:33:11 +02:00

Account API endpoint fixes

This commit is contained in:
binwiederhier 2022-12-28 15:51:09 -05:00
parent f79348817f
commit 7ca9afad57
7 changed files with 15 additions and 13 deletions
web/src/app

View file

@ -45,12 +45,12 @@ class AccountApi {
return json.token;
}
async logout(token) {
async logout() {
const url = accountTokenUrl(config.baseUrl);
console.log(`[AccountApi] Logging out from ${url} using token ${token}`);
console.log(`[AccountApi] Logging out from ${url} using token ${session.token()}`);
const response = await fetch(url, {
method: "DELETE",
headers: withBearerAuth({}, token)
headers: withBearerAuth({}, session.token())
});
if (response.status === 401 || response.status === 403) {
throw new UnauthorizedError();