1.0.1 • Published 2 years ago

@novo-x/aws-cognito v1.0.1

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

AWS Cognito Service

  • The service implementation is very simple with only one function to validate the session token.
  • The authentication has to be made in the frontend.
  • I will leave here an example on how to implement it in React with amazon-cognito-identity-js.

Available methods

  • validateToken: validates a user token with a cognito user pool

Usage examples

yarn add @novo-x/aws-cognito

import {Cognito} from "@novo-x/aws-cognito"

const MyService = new Cognito(
    {} // optional cognito instance config
);

const result = MyService.validate(
    '123456789', // userToken
    (result) => {} // callback to be executed after validation
)

Dependencies

cognito-express