Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including bragg-cognito-idp with all npm packages installed. Try it out:

var braggCognitoIdp = require("bragg-cognito-idp")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

bragg-cognito-idp v0.1.1

Bragg middleware for Cognito Userpool triggers

bragg-cognito-idp Build Status

Bragg middleware for AWS Cognito Userpool triggers

About

AWS Cognito Userpools uses different triggers to customize the authentication flow. The bragg-cognito-idp middleware for bragg provides 3 triggers that are essential for a custom implementation of the authentication flow.

Install

$ npm install bragg-cognito-idp

Usage

const app = require('bragg');
const router = require('bragg-router');
const cognito = require('bragg-cognito-idp');

router.post('idp:DefineAuthChallenge', ctx => {
    ctx.body = ctx.request.body
});

router.post('idp:CreateAuthChallenge', ctx => {
    ctx.body = ctx.request.body
});

router.post('idp:VerifyAuthChallengeResponse', ctx => {
    ctx.body = ctx.request.body
});

app.use(cognito());
app.use(router.routes());

exports.handler = app.listen();

API

cognito()

Install the cognito middleware.

License

MIT © Simon Jang

Metadata

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free