kopterio / vue-auth-cognito

A Vue.js Vuex module for authentication using Amazon AWS Cognito
114 stars 27 forks source link

Modify authenticateUser to handle the new callbacks. #48

Open joefresco opened 7 years ago

joefresco commented 7 years ago

This was written as a fix for: https://github.com/kopterio/vue-auth-cognito/issues/45 amazon-cognito-identity-js changed in late 2016 to use a different callback instead of reusing "success". That broke vue-auth-cognito.

Add completeNewPasswordChallenge for users created by the admin so users can set their password and be logged in. Required adding lodash.clonedeep to persist the cognitoUser object. I couldn't find any other way to reuse the cognitoUser object "elegently."

I did reuse the userConfirmationNecessary flag that already existed, though this will still require modifying any code that would have used the old code.

This implementation is still missing

  1. Unit tests
  2. Documentation on using it
  3. mfaRequired handling, which we aren't using. I added the stub for it.

I also left a lot of comments in the code from the documentation.