cryptic-game / cryptic-term

official minimal frontend of cryptic-game.net

Home Page:https://cryptic-game.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logging out throws error 'token required'

Scriptim opened this issue · comments

commented

Steps To Reproduce:

$ login
username: <username>
password:
$ exit
token required
$

Server Response:

{
    "url": "https://user.api.cryptic-game.net/auth",
    "ok": false,
    "status": 400,
    "statusText": "",
    "headers": {
        "map": {
            "content-type": [
                "application/json"
            ]
        }
    },
    "body": {
        "message": "token required"
    },
    "bodyText": "{\n    \"message\": \"token required\"\n}\n"
}

Related API Function:

cryptic-term/js/api.js

Lines 27 to 38 in 7416805

logout: () => {
return Vue.http.delete('https://user.api.cryptic-game.net/auth', '', {
headers: {
Token: app.dataStorage.token
}
}).then(response => {
console.log(response)
if (!response.ok) {
throw response
}
})
}