By using Angular and aws-amplify, would it be possible to poll for an existing account in cognito if the only attribute that I am capturing are first name, last name and date of birth? This will pretty much void auth in a way.
Please note: Our application does not allow any new library to be imported. We are working with what we have.
Certainly it is possible to write a piece of code which queries user pool and informs if there is a match.
Alternative 1: Enable Amplify AdminQueries API and use listUsers to retrieve users. Command syntax allows using AttributesToGet and Filter to modify the query.
{
"AttributesToGet": [ "string" ],
"Filter": "string",
"Limit": number,
"PaginationToken": "string",
"UserPoolId": "string"
}
Alternative 2: If possible, use Cognito API directly. @aws-sdk/client-cognito-identity-provider has the class ListUsersCommand. Its interface ListUsersCommandInput has properties AttributesToGet and Filter which can be used to fetch desired results.
I have managed to find a solution to my specific problem. By using confirmSignUp, I can catch the result and add a conditional statement within its scope.