Closed forrest-akin closed 7 years ago
@forrest-akin I was wondering if this is worth handling. I think we should throw the appropriate error for sure. But I'm not sure if we want to help people set a new password through this tool.
Agreed. For people following the guide step-by-step, it isn't required. I needed it because I was using bits and pieces of the guide to fill in the gaps for what I'm working on. A helpful error message should suffice!
Makes sense. Just updated it.
Looks good, thanks!
If the cognito user being authenticated is signing in for the first time, they might need to set a new password as well as any other required attributes. I don't think there's a way of pausing execution to accept more args with yargs (maybe with Vorpal), but here's the function signature for newPasswordRequired to be added to the callback object in
cognitoUser.authenticateUser(authenticationDetails, callbacks)