isotoma / react-cognito

Library for integrating Facebook React and Amazon Cognito
Apache License 2.0
116 stars 48 forks source link

Fix BUG performLogin called multiple times #37

Open orther opened 6 years ago

orther commented 6 years ago

Fix isotoma/react-cognito/issues/35

Since enable caused the policy function to be called for every action dispatched to the store, any action(s) dispatched between state.cognito.state transitions could caused duplicate calls of the policy function.

To fix this the store subscription handler checks if state.cognito.state has changed and only calls the policy function if it has.