Skip to content

Microservice to send custom messages in HTML to AWS Cognito users.

Notifications You must be signed in to change notification settings

kusakusakusa/dareda

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DESCRIPTION

Microservice to send custom messages in HTML to AWS Cognito users.

USAGE

VALIDATE UNIQUE EMAILS

A handler to check for uniuqe emails for the case of having a Cognito username that is not the email. This is meant for use in the PreSignup Lambda trigger only.

Often, we allow users to change email, but setting the email as username in Cognito means that even if they change their email, they can still login via their old email whih is their username.

The alternative is to set username as some sort of id like UUID and allow login via email.

However, Cognito allows duplicate emails with different UUID/username to sign up. To prevent this, @bsdkurt came up with a solution to use the PreSignup Lambda trigger to validate the uniqueness of emails.

This lambda trigger is under the function name validateUniqueEmails in the handler export.

SETUP

  1. Create an AWS user with programmatic access. Deployment will be using named profiles. Permissions of the AWS user TODO

  2. Make a copy of the envsample.yml file and rename it as env.yml to utilise variables from the Serverless framework.

  3. Replace the env variables accordingly.

DEPLOYMENT

Run the command:

$ sls deploy --stage <STAGE_NAME>

TODO

  • Handle more scenarios other than CustomMessage_AdminCreateUser
  • Handle Cognito link option instead of code optins

About

Microservice to send custom messages in HTML to AWS Cognito users.

Resources

Stars

Watchers

Forks

Packages

No packages published