bartonhammond/snowflake

logout error: JSON Parse error unrecognized token '<'

Closed this issue · 1 comments

Everything except logout works well. When a user logs out, an error message pops up. It shows "JSON Parse error: unrecognized token '<'". I did some debugging and found the error message was ejected out by the following highlighted 'catch(error)' on Line 144 in 'Parse.js'. Any idea how to fix it?

async logout() {
return await this.fetch({
method: 'POST',
url: '/1/logout',
body: {}
})
.then((response) => {
var res = JSON.parse(response.bodyInit);
if ((response.status === 200 || response.status === 201)
|| //invalid session token
(response.status === 400 && res.code === 209)) {
return {};
} else {
throw({code: 404, error: 'unknown error from Parse.com'});
}
})
**
.catch((error) => {
throw(error);
});
**

@shenjun This is only happening w/ a Parse.com server implementation? Can you log the response.status and res.code? Have you tried this w/ a local Hapi?

I just tested against a Parse server and it works fine. I don't know how to replicate your error.