Skip to content

Instantly share code, notes, and snippets.

@alexastrum
Last active August 3, 2020 16:32
Show Gist options
  • Save alexastrum/b6714a60b55044e8ac36d59c569ec37f to your computer and use it in GitHub Desktop.
Save alexastrum/b6714a60b55044e8ac36d59c569ec37f to your computer and use it in GitHub Desktop.
const deviceToken = req.body;
const { header, payload } = decode(deviceToken);
const device = header.kid && (await getDevice(header.kid));
if (!device) {
res.send({
message: "Unknown device!",
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment