Custom message for disabled user during signup

0

I have a CloudFront site that I want to password protect. I have set up the site using the "cloudfront-authorization-at-edge" Lambda Application. After I got it set up I configured Cognito to allow self registration using email verification. I have set up a Cognito post authentication handler that looks at the email domain for the new signups. Emails domains are compared to a pre-approved list. If an email domain is on the pre-approved list then a welcome email is sent and the handler completes normally, For emails not on the pre-approved list the user is disabled and an email is sent saying that the account is pending (to be manually enabled by the admin).

This all works great, except that after the handler returns for a disabled account the message display in the browser is "An error was encountered with the requested page. User is disabled". This message will be presented before the user will get a chance to read the email that tells them about being in a pending state waiting approval, and I think that it will be confusing because it suggests that something went wrong.

Is there a way that I can change or augment this message? Something like "Account access is pending administrator approval. Check the email sent to {email}". I don't see how I can redirect at this stage.

Or can you suggest a better workflow for having self registration with a pre-approved list?

Opeongo
asked 5 months ago48 views
No Answers

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions