1

In amplify there is an option user can sign-in through preferred_username. But During sign-up it is asking a username that is not preferred_username & that is immutable. After email conformation user can chose their preferred_username(it can be changed later on if that preferred_username available). Now user can sign-in through username(given during sign up),email & preferred_username(chosen after email conformation). Now this is very odd that one user have 2 username one is immutable and other is mutable.

I WANT

  1. I want to access the sub(32 character unique user ID) in pre-signup lambda function.
  2. Then I will pass a UUID in place of username instead of user choice because I don't want to tell the username to user that is required during sign-up. User should know only one username that is preferred_username.
  3. Then in lambda function I will make sub=username(the username value will be assigned to sub that is a UUID) or if I can't modify sub I we will make it username=sub(the sub value will be assigned to username).

MY QUESTION

  1. Is it possible to access sub in pre-signup function?(I tried but got error: Cannot read properties of undefined. I think there will be 2 possibilities either we can access or modify sub at any cost or there will be other method which I don't know).
  2. Is it possible to modify username in pre-signup function?(I tried but got error: Invalid user name. User name in Lambda mismatches the actual username.. I think there will be other method).
  3. Is there any limitations for social sign-in the things I am expecting?
ThinQ
  • 19
  • 5

0 Answers0