Skip to content

Instantly share code, notes, and snippets.

@anchetaWern
Last active May 31, 2019 08:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anchetaWern/1db286cc4a92798f7f058303a6d650a6 to your computer and use it in GitHub Desktop.
Save anchetaWern/1db286cc4a92798f7f058303a6d650a6 to your computer and use it in GitHub Desktop.
React Native Stream Group Chat Tutorial: add auth route
// server/server.js
app.post("/auth", async (req, res) => {
const user_id = req.body.user_id;
console.log('user ID: ', user_id);
if (!user_id) {
return res.status(400);
}
return res.send({
token: server_side_client.createToken(user_id)
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment