Browse Source

login: don't attempt json parsing if non-200

master
Guillermo Rauch 9 years ago
parent
commit
9d886bb6fc
  1. 4
      lib/login.js

4
lib/login.js

@ -28,6 +28,10 @@ async function getVerificationToken (email) {
body: data
});
if (200 !== res.status) {
throw new Error('Verification error');
}
const body = await res.json();
return body.token;
}

Loading…
Cancel
Save