Skip to content

Instantly share code, notes, and snippets.

@MeetMartin
Last active February 7, 2022 22:48
Show Gist options
  • Save MeetMartin/8c5a2cefc88765ef1e769873981a3b01 to your computer and use it in GitHub Desktop.
Save MeetMartin/8c5a2cefc88765ef1e769873981a3b01 to your computer and use it in GitHub Desktop.
const Callback = request =>
compose(
map(passThrough(() => logger.debug('DID Authentication Callback Request Stored In Fauna.'))),
flatMap(storeSuccessfulAuthentication),
flatMap(request => eitherToAsyncEffect(encryptDID(request))),
flatMap(validateChallenge),
eitherToAsyncEffect,
validateRequest,
map(passThrough(request => logger.debug(`DID Authentication Callback Request: ${deepInspect(request)}`))),
)(request);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment