DEV Community

Discussion on: Passwordless Authentication with Cognito

Collapse
 
oldtinroof profile image
Les Cochrane

Thank you Duarte, this has been a fantastic post for me to get my head around OTP with Cognito - I'm porting it over to JS as I've got more experience with that but I'm stuck on the last couple of steps.

Is the auth you call for auth.SetAttributes, and auth.CreateUser from an SDK, or a private library?

Collapse
 
duarten profile image
Duarte Nunes

Glad you enjoyed it :D

The auth module is a private library. Essentially, SetAttributes() wraps AdminUpdateUserAttributes, and CreateUser wraps AdminCreateUser and AdminSetUserPassword with a random password.

Collapse
 
oldtinroof profile image
Les Cochrane • Edited

Awesome, that's exactly the nudge in the right direction I needed, thank you.

One of the things that sets your post apart (in a positive way) is that you didn't give code for every single step, so it's encouraged me to go research and really understand what's going on and write my own equivalent of the auth library. Cheers!