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:
parent
f79348817f
commit
7ca9afad57
7 changed files with 15 additions and 13 deletions
web/src/app
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue