Skip to content

Instantly share code, notes, and snippets.

@cardoso
Created May 1, 2020 17:44
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 cardoso/a578332666d43a3ee6f18274a300af78 to your computer and use it in GitHub Desktop.
Save cardoso/a578332666d43a3ee6f18274a300af78 to your computer and use it in GitHub Desktop.
const userData = await storage.get(appleUid);
if (!userData) {
console.log(`[ERROR] User not found in persistent storage.`);
res.sendStatus(404);
return;
}
const response = {
apiKey,
streamId: userData.streamId,
streamToken: streamClient.createToken(userData.streamId),
email: userData.email,
name: userData.name
}
console.log(`[INFO] User signed in successfully with response: ${JSON.stringify(response)}.`);
res.send(response);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment