From ae02091f4514183056a09ec17369ea94defaaaba Mon Sep 17 00:00:00 2001 From: Colin Findlay Date: Tue, 9 Jan 2018 13:12:40 +1300 Subject: [PATCH 1/2] Make identityPool authorization optional for people the only want userPool authentication. --- src/auth.js | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/src/auth.js b/src/auth.js index 8304673..e301acd 100644 --- a/src/auth.js +++ b/src/auth.js @@ -45,8 +45,8 @@ const refreshIdentityCredentials = (username, jwtToken, config) => }); /** - * establishes a session with the user pool, and logs into the federated identity - * pool using a token from the session + * establishes a session with the user pool, and optionally logs into the federated identity + * pool using a token from the session. * @param {object} user - the CognitoUser object * @param {object} config -the react-cognito config * @return {Promise} an action to be dispatched @@ -66,14 +66,20 @@ const performLogin = (user, config, group) => return resolve(Action.loginFailure(user, 'Insufficient privilege')); } - const username = user.getUsername(); - refreshIdentityCredentials(username, jwtToken, config).then( - (creds) => { - getUserAttributes(user).then((attributes) => { - resolve(Action.login(creds, attributes, groups)); - }); - }, - message => resolve(Action.loginFailure(user, message))); + if (config.identityPool) { + const username = user.getUsername(); + refreshIdentityCredentials(username, jwtToken, config).then( + (creds) => { + getUserAttributes(user).then((attributes) => { + resolve(Action.login(creds, attributes, groups)); + }); + }, + message => resolve(Action.loginFailure(user, message))); + } else { + getUserAttributes(user).then((attributes) => { + resolve(Action.login(null, attributes, groups)); + }); + } } }); } @@ -83,7 +89,7 @@ const performLogin = (user, config, group) => * * Authenticates with a user pool, and handles responses. * if the authentication is successful it then logs in to the - * identity pool. + * identity pool if provided in config. * * returns an action depending on the outcome. Possible actions returned * are: From 89efc7641e45007b429487bd27245d145cad5ea7 Mon Sep 17 00:00:00 2001 From: silver2k Date: Wed, 31 Jan 2018 11:23:44 +1300 Subject: [PATCH 2/2] Publish direct to git while waiting for PR to merge --- .gitignore | 1 - dist/react-cognito.js | 2794 +++++++++++++++++++++++++++++++++ dist/react-cognito.js.map | 1 + dist/react-cognito.min.js | 2 + dist/react-cognito.min.js.map | 1 + 5 files changed, 2798 insertions(+), 1 deletion(-) create mode 100644 dist/react-cognito.js create mode 100644 dist/react-cognito.js.map create mode 100644 dist/react-cognito.min.js create mode 100644 dist/react-cognito.min.js.map diff --git a/.gitignore b/.gitignore index beee1ef..1ee765a 100644 --- a/.gitignore +++ b/.gitignore @@ -6,7 +6,6 @@ .idea npm-debug.log node_modules -dist *.sublime-workspace path.sh examples/config.json diff --git a/dist/react-cognito.js b/dist/react-cognito.js new file mode 100644 index 0000000..0a0f346 --- /dev/null +++ b/dist/react-cognito.js @@ -0,0 +1,2794 @@ +(function webpackUniversalModuleDefinition(root, factory) { + if(typeof exports === 'object' && typeof module === 'object') + module.exports = factory(require("amazon-cognito-identity-js"), require("aws-sdk/global"), require("react"), require("react-redux")); + else if(typeof define === 'function' && define.amd) + define(["amazon-cognito-identity-js", "aws-sdk/global", "react", "react-redux"], factory); + else if(typeof exports === 'object') + exports["ReactCognito"] = factory(require("amazon-cognito-identity-js"), require("aws-sdk/global"), require("react"), require("react-redux")); + else + root["ReactCognito"] = factory(root["AmazonCognitoIdentity"], root["aws-sdk/global"], root["React"], root["ReactRedux"]); +})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_13__) { +return /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) +/******/ return installedModules[moduleId].exports; +/******/ +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ exports: {}, +/******/ id: moduleId, +/******/ loaded: false +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.loaded = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = ""; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(0); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/*!**********************!*\ + !*** ./src/index.js ***! + \**********************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + var _reducers = __webpack_require__(/*! ./reducers */ 1); + + Object.keys(_reducers).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _reducers[key]; + } + }); + }); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + Object.keys(_actions).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _actions[key]; + } + }); + }); + + var _states = __webpack_require__(/*! ./states */ 3); + + Object.keys(_states).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _states[key]; + } + }); + }); + + var _utils = __webpack_require__(/*! ./utils */ 5); + + Object.keys(_utils).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _utils[key]; + } + }); + }); + + var _guard = __webpack_require__(/*! ./guard */ 7); + + Object.keys(_guard).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _guard[key]; + } + }); + }); + + var _auth = __webpack_require__(/*! ./auth */ 8); + + Object.keys(_auth).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _auth[key]; + } + }); + }); + + var _attributes = __webpack_require__(/*! ./attributes */ 9); + + Object.keys(_attributes).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _attributes[key]; + } + }); + }); + + var _policy = __webpack_require__(/*! ./policy */ 10); + + Object.keys(_policy).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _policy[key]; + } + }); + }); + + var _Login = __webpack_require__(/*! ./Login.jsx */ 11); + + Object.keys(_Login).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _Login[key]; + } + }); + }); + + var _Logout = __webpack_require__(/*! ./Logout.jsx */ 14); + + Object.keys(_Logout).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _Logout[key]; + } + }); + }); + + var _NewPasswordRequired = __webpack_require__(/*! ./NewPasswordRequired.jsx */ 23); + + Object.keys(_NewPasswordRequired).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _NewPasswordRequired[key]; + } + }); + }); + + var _EmailVerification = __webpack_require__(/*! ./EmailVerification.jsx */ 24); + + Object.keys(_EmailVerification).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _EmailVerification[key]; + } + }); + }); + + var _PasswordReset = __webpack_require__(/*! ./PasswordReset.jsx */ 25); + + Object.keys(_PasswordReset).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _PasswordReset[key]; + } + }); + }); + + var _Confirm = __webpack_require__(/*! ./Confirm.jsx */ 26); + + Object.keys(_Confirm).forEach(function (key) { + if (key === "default" || key === "__esModule") return; + Object.defineProperty(exports, key, { + enumerable: true, + get: function get() { + return _Confirm[key]; + } + }); + }); + +/***/ }), +/* 1 */ +/*!*************************!*\ + !*** ./src/reducers.js ***! + \*************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.cognito = undefined; + + var _amazonCognitoIdentityJs = __webpack_require__(/*! amazon-cognito-identity-js */ 2); + + var _states = __webpack_require__(/*! ./states */ 3); + + /* global AWS */ + + var initial = { + user: null, + cache: { // cached for post register login + userName: null, + email: null + }, + state: _states.CognitoState.LOGGED_OUT, + error: '', + userPool: null, + attributes: {}, + creds: null, + groups: [], + config: { + region: null, + userPool: null, + clientId: null, + identityPool: null + } + }; + + var configure = function configure(state, action) { + // surprise side-effect! + AWS.config.region = action.config.region; + var pool = new _amazonCognitoIdentityJs.CognitoUserPool({ + UserPoolId: action.config.userPool, + ClientId: action.config.clientId + }); + var user = pool.getCurrentUser(); + return Object.assign({}, state, { + config: action.config, + userPool: pool, + user: user + }); + }; + + // sometimes we don't get the attributes in later parts of the login flow + // but lets not clobber the ones we've got if we've not got them + var addAttributes = function addAttributes(s, attributes) { + var s2 = Object.assign({}, s); + if (attributes) { + s2.attributes = attributes; + } + return s2; + }; + + /** + * reducer function to be passed to redux combineReducers + * @param {object} state + * @param {object} action + */ + + var cognito = exports.cognito = function cognito() { + var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initial; + var action = arguments[1]; + + switch (action.type) { + + case 'COGNITO_CONFIGURE': + return configure(state, action); + + case 'COGNITO_AUTHENTICATED': + return Object.assign({}, state, { + user: action.user, + cache: { + userName: null, + email: null + }, + error: '', + state: _states.CognitoState.AUTHENTICATED + }); + + case 'COGNITO_CLEAR_CACHE': + return Object.assign({}, state, { + cache: { + userName: null, + email: null + } + }); + + case 'COGNITO_LOGGING_IN': + return Object.assign({}, state, { + state: _states.CognitoState.LOGGING_IN, + attributes: action.attributes + }); + + case 'COGNITO_LOGIN': + return Object.assign({}, state, addAttributes({ + error: '', + creds: action.creds, + groups: action.groups, + state: _states.CognitoState.LOGGED_IN + }, action.attributes)); + + case 'COGNITO_LOGOUT': + return Object.assign({}, state, { + user: null, + attributes: {}, + error: '', + creds: null, + groups: [], + state: _states.CognitoState.LOGGED_OUT + }); + + case 'COGNITO_PARTIAL_LOGOUT': + return Object.assign({}, state, { + user: null, + userName: state.user.username, + error: '', + creds: null, + groups: [], + state: _states.CognitoState.LOGGED_OUT + }); + + case 'COGNITO_LOGIN_FAILURE': + return Object.assign({}, state, { + user: action.user, + state: _states.CognitoState.LOGGED_OUT, + error: action.error + }); + + case 'COGNITO_LOGIN_MFA_REQUIRED': + return Object.assign({}, state, { + user: action.user, + error: '', + state: _states.CognitoState.MFA_REQUIRED + }); + + case 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED': + return Object.assign({}, state, { + user: action.user, + error: '', + state: _states.CognitoState.NEW_PASSWORD_REQUIRED + }); + + case 'COGNITO_USER_UNCONFIRMED': + return Object.assign({}, state, { + user: action.user, + state: _states.CognitoState.CONFIRMATION_REQUIRED, + cache: { + userName: action.user.username, + email: action.email ? action.email : state.cache.email + } + }); + + case 'COGNITO_USER_CONFIRM_FAILED': + return Object.assign({}, state, { + user: action.user, + state: _states.CognitoState.CONFIRMATION_REQUIRED, + error: action.error + }); + + case 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE': + return Object.assign({}, state, { + error: action.error, + state: _states.CognitoState.NEW_PASSWORD_REQUIRED + }); + + case 'COGNITO_EMAIL_VERIFICATION_REQUIRED': + return Object.assign({}, state, addAttributes({ + error: '', + state: _states.CognitoState.EMAIL_VERIFICATION_REQUIRED + }, action.attributes)); + + case 'COGNITO_EMAIL_VERIFICATION_FAILED': + return Object.assign({}, state, addAttributes({ + error: action.error, + state: _states.CognitoState.EMAIL_VERIFICATION_REQUIRED + }, action.attributes)); + + case 'COGNITO_BEGIN_PASSWORD_RESET_FLOW': + return Object.assign({}, state, { + error: action.error + }); + + case 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW': + return state; + + case 'COGNITO_FINISH_PASSWORD_RESET_FLOW': + return state; + + // this moves us into the AUTHENTICATED state, potentially causing + // a number of side-effects. this is so we can re-verify the email + // address if we have to + case 'COGNITO_UPDATE_USER_ATTRIBUTES': + return Object.assign({}, state, { + attributes: Object.assign({}, state.attributes, action.attributes), + state: _states.CognitoState.AUTHENTICATED + }); + + default: + return state; + } + }; + +/***/ }), +/* 2 */ +/*!*********************************************************************************************************************************************************************!*\ + !*** external {"root":"AmazonCognitoIdentity","commonjs2":"amazon-cognito-identity-js","commonjs":"amazon-cognito-identity-js","amd":"amazon-cognito-identity-js"} ***! + \*********************************************************************************************************************************************************************/ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_2__; + +/***/ }), +/* 3 */ +/*!***********************!*\ + !*** ./src/states.js ***! + \***********************/ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + /** states stored in store.cognito.state */ + var CognitoState = exports.CognitoState = { + LOGGED_OUT: 'LOGGED_OUT', + AUTHENTICATED: 'AUTHENTICATED', + LOGGING_IN: 'LOGGING_IN', + LOGGED_IN: 'LOGGED_IN', + NEW_PASSWORD_REQUIRED: 'NEW_PASSWORD_REQUIRED', + MFA_REQUIRED: 'MFA_REQUIRED', + EMAIL_VERIFICATION_REQUIRED: 'EMAIL_VERIFICATION_REQUIRED', + CONFIRMATION_REQUIRED: 'CONFIRMATION_REQUIRED' + }; + +/***/ }), +/* 4 */ +/*!************************!*\ + !*** ./src/actions.js ***! + \************************/ +/***/ (function(module, exports) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + /** + * container for all the actions + */ + var Action = { + + configure: function configure(config) { + return { + type: 'COGNITO_CONFIGURE', + config: config + }; + }, + + authenticated: function authenticated(user) { + return { + type: 'COGNITO_AUTHENTICATED', + user: user + }; + }, + + loggingIn: function loggingIn(attributes) { + return { + type: 'COGNITO_LOGGING_IN', + attributes: attributes + }; + }, + + login: function login(creds, attributes, groups) { + return { + type: 'COGNITO_LOGIN', + creds: creds, + groups: groups, + attributes: attributes + }; + }, + + logout: function logout() { + return { + type: 'COGNITO_LOGOUT' + }; + }, + + partialLogout: function partialLogout() { + return { + type: 'COGNITO_PARTIAL_LOGOUT' + }; + }, + + loginFailure: function loginFailure(user, error) { + return { + type: 'COGNITO_LOGIN_FAILURE', + user: user, + error: error + }; + }, + + mfaRequired: function mfaRequired(user) { + return { + type: 'COGNITO_LOGIN_MFA_REQUIRED', + user: user + }; + }, + + newPasswordRequired: function newPasswordRequired(user) { + return { + type: 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED', + user: user + }; + }, + + newPasswordRequiredFailure: function newPasswordRequiredFailure(user, error) { + return { + type: 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE', + user: user, + error: error + }; + }, + + emailVerificationRequired: function emailVerificationRequired(attributes) { + return { + type: 'COGNITO_EMAIL_VERIFICATION_REQUIRED', + attributes: attributes + }; + }, + + emailVerificationFailed: function emailVerificationFailed(user, error) { + return { + type: 'COGNITO_EMAIL_VERIFICATION_FAILED', + user: user, + error: error + }; + }, + + beginPasswordResetFlow: function beginPasswordResetFlow(user, error) { + return { + type: 'COGNITO_BEGIN_PASSWORD_RESET_FLOW', + user: user, + error: error + }; + }, + + continuePasswordResetFlow: function continuePasswordResetFlow(user) { + return { + type: 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW', + user: user + }; + }, + + finishPasswordResetFlow: function finishPasswordResetFlow(error) { + return { + type: 'COGNITO_FINISH_PASSWORD_RESET_FLOW', + error: error + }; + }, + + updateAttributes: function updateAttributes(attributes) { + return { + type: 'COGNITO_UPDATE_USER_ATTRIBUTES', + attributes: attributes + }; + }, + + confirmationRequired: function confirmationRequired(user, email) { + return { + type: 'COGNITO_USER_UNCONFIRMED', + user: user, + email: email + }; + }, + + confirmFailed: function confirmFailed(user, error) { + return { + type: 'COGNITO_USER_CONFIRM_FAILED', + user: user, + error: error + }; + }, + + clearCache: function clearCache() { + return { + type: 'COGNITO_CLEAR_CACHE' + }; + } + }; + + exports.Action = Action; + +/***/ }), +/* 5 */ +/*!**********************!*\ + !*** ./src/utils.js ***! + \**********************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.getGroups = exports.buildLogins = exports.changePassword = undefined; + + var _global = __webpack_require__(/*! aws-sdk/global */ 6); + + /** + * Change a user's password + * @param {object} user - the cognito user object + * @param {string} oldPassword - the current password + * @param {string} newPassword - the new password + */ + var changePassword = function changePassword(user, oldPassword, newPassword) { + return new Promise(function (resolve, reject) { + return user.changePassword(oldPassword, newPassword, function (err, result) { + if (err) { + reject(err.message); + } else { + resolve(result); + } + }); + }); + }; + + /** + * builds the federated identity pool login structure + * @param {string} username - the username of the user + * @param {string} jwtToken - a JWT Token from the session + * @param {object} config - the cognito react config object + */ + var buildLogins = function buildLogins(username, jwtToken, config) { + var loginDomain = 'cognito-idp.' + config.region + '.amazonaws.com'; + var loginUrl = loginDomain + '/' + config.userPool; + var creds = { + IdentityPoolId: config.identityPool, + Logins: {}, + LoginId: username // https://github.com/aws/aws-sdk-js/issues/609 + }; + creds.Logins[loginUrl] = jwtToken; + return creds; + }; + + /** + * Decode a jwtToken to check for cognito:groups + * @param {string} jwtToken - a JWT Token from the session + */ + var getGroups = function getGroups(jwtToken) { + var payload = jwtToken.split('.')[1]; + var decodedToken = JSON.parse(_global.util.base64.decode(payload).toString('utf8')); + // decodedToken['cognito:groups'] can be undefined if user is in no groups + if (!decodedToken['cognito:groups']) { + return []; + } + return decodedToken['cognito:groups']; + }; + + exports.changePassword = changePassword; + exports.buildLogins = buildLogins; + exports.getGroups = getGroups; + +/***/ }), +/* 6 */ +/*!*********************************!*\ + !*** external "aws-sdk/global" ***! + \*********************************/ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_6__; + +/***/ }), +/* 7 */ +/*!**********************!*\ + !*** ./src/guard.js ***! + \**********************/ +/***/ (function(module, exports) { + + "use strict"; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + + /* + Default behaviour is to restrict access to only logged in users + */ + + var testLoggedIn = function testLoggedIn(state, wantLoggedIn) { + var isLoggedIn = state.cognito.user !== null; + if (isLoggedIn && wantLoggedIn) { + return true; + } + if (!isLoggedIn && !wantLoggedIn) { + return true; + } + return false; + }; + + var permitted = function permitted(state, expr) { + return new Promise(function (resolve) { + if (expr.loggedIn !== undefined) { + resolve(testLoggedIn(state, expr.loggedIn)); + } else { + resolve(testLoggedIn(state, true)); + } + }); + }; + + var guard = function guard(store, forbiddenUrl) { + var expr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {}; + var routeState = arguments[3]; + var replace = arguments[4]; + var callback = arguments[5]; + + var state = store.getState(); + var dest = forbiddenUrl; + + if (expr.forbiddenUrl !== undefined) { + dest = expr.forbiddenUrl; + } + permitted(state, expr).then(function (allow) { + if (!allow) { + replace(dest); + } + callback(); + }); + }; + + /** + * creates a guard function you can use in tags + * @param {object} store - the redux store + * @param {string} forbiddenUrl - the default url to navigate to if forbidden + * @returns {function} - a function that can be provided to onEnter + */ + var createGuard = function createGuard(store, forbiddenUrl) { + return function (expr) { + return function (state, replace, callback) { + return guard(store, forbiddenUrl, expr, state, replace, callback); + }; + }; + }; + + exports.createGuard = createGuard; + +/***/ }), +/* 8 */ +/*!*********************!*\ + !*** ./src/auth.js ***! + \*********************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.emailVerificationFlow = exports.registerUser = exports.performLogin = exports.authenticate = undefined; + + var _amazonCognitoIdentityJs = __webpack_require__(/*! amazon-cognito-identity-js */ 2); + + var _global = __webpack_require__(/*! aws-sdk/global */ 6); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + var _attributes = __webpack_require__(/*! ./attributes */ 9); + + var _utils = __webpack_require__(/*! ./utils */ 5); + + /** + * sends the email verification code and transitions to the correct state + * @param {object} user - the CognitoUser object + * @param {object} attributes - the attributes dictionary + * @return {Promise} a promise that resolves to a redux action + */ + var emailVerificationFlow = function emailVerificationFlow(user, attributes) { + return new Promise(function (resolve) { + return (0, _attributes.sendAttributeVerificationCode)(user, 'email').then(function (required) { + if (required) { + resolve(_actions.Action.emailVerificationRequired(attributes)); + } else { + // dead end? + resolve(_actions.Action.loggingIn(attributes)); + } + }, function (error) { + // some odd classes of error here + resolve(_actions.Action.emailVerificationFailed(error, attributes)); + }); + }); + }; + + /** + * logs in to the federated identity pool with a JWT + * @param {string} username - the username + * @param {string} jwtToken - a token from the session + * @param {object} config - the react-cognito config + * @return {Promise} a promise that resolves to the federated identity credentials + */ + var refreshIdentityCredentials = function refreshIdentityCredentials(username, jwtToken, config) { + return new Promise(function (resolve, reject) { + var logins = (0, _utils.buildLogins)(username, jwtToken, config); + var creds = new _global.CognitoIdentityCredentials(logins, { region: config.region }); + creds.refresh(function (error) { + if (error) { + reject(error.message); + } else { + resolve(creds); + } + }); + }); + }; + + /** + * establishes a session with the user pool, and optionally logs into the federated identity + * pool using a token from the session. + * @param {object} user - the CognitoUser object + * @param {object} config -the react-cognito config + * @return {Promise} an action to be dispatched + */ + var performLogin = function performLogin(user, config, group) { + return new Promise(function (resolve, reject) { + if (user === null) { + resolve(_actions.Action.logout()); + } else { + user.getSession(function (err, session) { + if (err) { + resolve(_actions.Action.loginFailure(user, err.message)); + } else { + var jwtToken = session.getIdToken().getJwtToken(); + var groups = (0, _utils.getGroups)(jwtToken); + if (group && !groups.includes(group)) { + return resolve(_actions.Action.loginFailure(user, 'Insufficient privilege')); + } + + if (config.identityPool) { + var username = user.getUsername(); + refreshIdentityCredentials(username, jwtToken, config).then(function (creds) { + (0, _attributes.getUserAttributes)(user).then(function (attributes) { + resolve(_actions.Action.login(creds, attributes, groups)); + }); + }, function (message) { + return resolve(_actions.Action.loginFailure(user, message)); + }); + } else { + (0, _attributes.getUserAttributes)(user).then(function (attributes) { + resolve(_actions.Action.login(null, attributes, groups)); + }); + } + } + }); + } + }); + }; + + /** + * + * Authenticates with a user pool, and handles responses. + * if the authentication is successful it then logs in to the + * identity pool if provided in config. + * + * returns an action depending on the outcome. Possible actions returned + * are: + * + * - login - valid user who is logged in + * - loginFailure - failed to authenticate with user pool or identity pool + * - mfaRequired - user now needs to enter MFA + * - newPasswordRequired - user must change password on first login + * - emailVerificationRequired - user must verify their email address + * - emailVerificationFailed - email verification is required, but won't work + * + * Dispatch the resulting action, e.g.: + * + * ``` + * const { userPool, config } = state.cognito; + * authenticate(username, password, userPool, config).then(dispatch); + * ``` + * + * @param {string} username - the username provided by the user + * @param {string} password - the password provided by the user + * @param {object} userPool - a Cognito User Pool object + * @return {Promise} - a promise that resolves an action to be dispatched + * + */ + var authenticate = function authenticate(username, password, userPool, config, dispatch) { + return new Promise(function (resolve, reject) { + var creds = new _amazonCognitoIdentityJs.AuthenticationDetails({ + Username: username, + Password: password + }); + + var user = new _amazonCognitoIdentityJs.CognitoUser({ + Username: username, + Pool: userPool + }); + + user.authenticateUser(creds, { + onSuccess: function onSuccess() { + dispatch(_actions.Action.authenticated(user)); + resolve(); + }, + onFailure: function onFailure(error) { + if (error.code === 'UserNotConfirmedException') { + dispatch(_actions.Action.confirmationRequired(user)); + resolve(); + } else { + dispatch(_actions.Action.loginFailure(user, error.message)); + reject(error); + } + }, + mfaRequired: function mfaRequired() { + dispatch(_actions.Action.mfaRequired(user)); + resolve(); + }, + newPasswordRequired: function newPasswordRequired() { + dispatch(_actions.Action.newPasswordRequired(user)); + resolve(); + } + }); + }); + }; + + /** + * sign up this user with the user pool provided + * @param {object} userPool - a Cognito userpool (e.g. state.cognito.userPool) + * @param {object} config - the react-cognito config object + * @param {string} username - the username + * @param {string} password - the password + * @param {object} attributes - an attributes dictionary + * @return {Promise} a promise that resolves a redux action + */ + var registerUser = function registerUser(userPool, config, username, password, attributes) { + return new Promise(function (resolve, reject) { + return userPool.signUp(username, password, (0, _attributes.mkAttrList)(attributes), null, function (err, result) { + if (err) { + reject(err.message); + } else if (result.userConfirmed === false) { + resolve(_actions.Action.confirmationRequired(result.user, attributes.email)); + } else { + resolve(authenticate(username, password, userPool)); + } + }); + }); + }; + + exports.authenticate = authenticate; + exports.performLogin = performLogin; + exports.registerUser = registerUser; + exports.emailVerificationFlow = emailVerificationFlow; + +/***/ }), +/* 9 */ +/*!***************************!*\ + !*** ./src/attributes.js ***! + \***************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.mkAttrList = exports.updateAttributes = exports.getUserAttributes = exports.sendAttributeVerificationCode = undefined; + + var _actions = __webpack_require__(/*! ./actions */ 4); + + /** + * Request that a verification code is sent by email or SMS to verify + * an attribute + * @param {object} user - the cognito user object + * @param {string} attribute - the attribute name + */ + var sendAttributeVerificationCode = function sendAttributeVerificationCode(user, attribute) { + return new Promise(function (resolve, reject) { + user.getAttributeVerificationCode(attribute, { + onSuccess: function onSuccess() { + return resolve(false); + }, + inputVerificationCode: function inputVerificationCode() { + return resolve(true); + }, + onFailure: function onFailure(error) { + return reject(error.message); + } + }); + }); + }; + + /** + * Fetches the user attributes from Cognito, and turns them into + * an object + * @param {object} user - the cognito user object + * @returns {Promise} resolves with the attributes or rejects with an error message + */ + var getUserAttributes = function getUserAttributes(user) { + return new Promise(function (resolve, reject) { + return user.getUserAttributes(function (error, result) { + if (error) { + reject(error.message); + } else { + var attributes = {}; + for (var i = 0; i < result.length; i += 1) { + var name = result[i].getName(); + var value = result[i].getValue(); + attributes[name] = value; + } + resolve(attributes); + } + }); + }); + }; + + /** + * convert an attribute dictionary to an attribute list + * @param {object} attributes - a dictionary of attributes + * @return {array} AWS expected attribute list + */ + var mkAttrList = function mkAttrList(attributes) { + return Object.keys(attributes).map(function (key) { + return { + Name: key, + Value: attributes[key] + }; + }); + }; + + /** + * update the attributes in Cognito + * @param {object} user - the CognitoUser object + * @param {object} attributes - an attributes dictionary with the attributes to be updated + * @return {Promise} a promise that resolves to a redux action + */ + var updateAttributes = function updateAttributes(user, attributes) { + return new Promise(function (resolve, reject) { + var attributeList = mkAttrList(attributes); + user.updateAttributes(attributeList, function (err) { + if (err) { + reject(err.message); + } else { + resolve(_actions.Action.updateAttributes(attributes)); + } + }); + }); + }; + + exports.sendAttributeVerificationCode = sendAttributeVerificationCode; + exports.getUserAttributes = getUserAttributes; + exports.updateAttributes = updateAttributes; + exports.mkAttrList = mkAttrList; + +/***/ }), +/* 10 */ +/*!***********************!*\ + !*** ./src/policy.js ***! + \***********************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.identityPoolLogin = exports.emailVerificationRequired = exports.fetchAttributes = exports.direct = exports.enable = exports.setupCognito = undefined; + + var _actions = __webpack_require__(/*! ./actions */ 4); + + var _attributes = __webpack_require__(/*! ./attributes */ 9); + + var _auth = __webpack_require__(/*! ./auth */ 8); + + var _states = __webpack_require__(/*! ./states */ 3); + + /** + * subscribes a "policy" function to the store, and calls it + * with the state and the dispatch function + * @param {object} store - the redux store + * @param {function} f - f(state, dispatch) + */ + var enable = function enable(store, f, params) { + store.subscribe(function () { + var state = store.getState(); + var dispatch = store.dispatch; + f(state, dispatch, params); + }); + }; + + /** + * requires email verification before transitioning from AUTHENTICATED + * @param {object} state - the redux store state + * @param {function} dispatch - the dispatch function + */ + var emailVerificationRequired = function emailVerificationRequired(state, dispatch) { + if (state.cognito.state === _states.CognitoState.AUTHENTICATED) { + var user = state.cognito.user; + (0, _attributes.getUserAttributes)(user).then(function (attributes) { + if (attributes.email_verified !== 'true') { + (0, _auth.emailVerificationFlow)(user, attributes).then(dispatch); + } else { + dispatch(_actions.Action.loggingIn(attributes)); + } + }); + } + }; + + /** + * fetches and stores attributes before transitioning from AUTHENTICATED + * @param {object} state - the redux store state + * @param {function} dispatch - the dispatch function + */ + var fetchAttributes = function fetchAttributes(state, dispatch) { + if (state.cognito.state === _states.CognitoState.AUTHENTICATED) { + var user = state.cognito.user; + (0, _attributes.getUserAttributes)(user).then(function (attributes) { + dispatch(_actions.Action.loggingIn(attributes)); + }); + } + }; + + /** + * transitions directly from AUTHENTICATED to LOGGING_IN + * @param {object} state - the redux store state + * @param {function} dispatch - the dispatch function + */ + var direct = function direct(state, dispatch) { + if (state.cognito.state === _states.CognitoState.AUTHENTICATED) { + dispatch(_actions.Action.loggingIn()); + } + }; + + /** + * logs into the single federated identity pool to transition from LOGGING_IN + * to LOGGED_IN + * @param {object} state - the redux store state + * @param {function} dispatch - the dispatch function + */ + var identityPoolLogin = function identityPoolLogin(state, dispatch, group) { + if (state.cognito.state === _states.CognitoState.LOGGING_IN) { + (0, _auth.performLogin)(state.cognito.user, state.cognito.config, group).then(dispatch); + } + }; + + /** + * sets up react-cognito with default policies. + */ + var setupCognito = function setupCognito(store, config) { + var listeners = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [emailVerificationRequired, identityPoolLogin]; + + store.dispatch(_actions.Action.configure(config)); + listeners.forEach(function (f) { + enable(store, f, config.group); + }); + store.dispatch(_actions.Action.loggingIn({})); + }; + + exports.setupCognito = setupCognito; + exports.enable = enable; + exports.direct = direct; + exports.fetchAttributes = fetchAttributes; + exports.emailVerificationRequired = emailVerificationRequired; + exports.identityPoolLogin = identityPoolLogin; + +/***/ }), +/* 11 */ +/*!***********************!*\ + !*** ./src/Login.jsx ***! + \***********************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Login = undefined; + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _reactRedux = __webpack_require__(/*! react-redux */ 13); + + var _auth = __webpack_require__(/*! ./auth */ 8); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BaseLogin = function BaseLogin(props) { + return _react2.default.cloneElement(props.children, { + username: props.username, + email: props.email, + onSubmit: props.onSubmit, + clearCache: props.clearCache, + error: props.error + }); + }; + + var mapStateToProps = function mapStateToProps(state) { + var username = ''; + if (state.cognito.user) { + username = state.cognito.user.getUsername(); + } else if (state.cognito.userName) { + username = state.cognito.cache.userName; + } + return { + username: username, + email: state.cognito.cache.email, + config: state.cognito.config, + userPool: state.cognito.userPool, + error: state.cognito.error + }; + }; + + var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + authenticator: function authenticator(username, password, userPool, config) { + return (0, _auth.authenticate)(username, password, userPool, config, dispatch); + }, + clearCache: function clearCache() { + return dispatch(_actions.Action.clearCache()); + } + }; + }; + + var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { + return Object.assign({}, ownProps, stateProps, { + onSubmit: function onSubmit(username, password) { + return dispatchProps.authenticator(username, password, stateProps.userPool, stateProps.config); + }, + clearCache: dispatchProps.clearCache + }); + }; + + /** + * Container for login behaviour, wrapping a login form. + * + * Magically provides the following props to the wrapped form: + * + * * username + * * onSubmit + * + * @example + * + * + * + */ + var Login = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseLogin); + + exports.Login = Login; + +/***/ }), +/* 12 */ +/*!**************************************************************************************!*\ + !*** external {"root":"React","commonjs2":"react","commonjs":"react","amd":"react"} ***! + \**************************************************************************************/ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_12__; + +/***/ }), +/* 13 */ +/*!*************************************************************************************************************!*\ + !*** external {"root":"ReactRedux","commonjs":"react-redux","commonjs2":"react-redux","amd":"react-redux"} ***! + \*************************************************************************************************************/ +/***/ (function(module, exports) { + + module.exports = __WEBPACK_EXTERNAL_MODULE_13__; + +/***/ }), +/* 14 */ +/*!************************!*\ + !*** ./src/Logout.jsx ***! + \************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Logout = undefined; + + var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }(); + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _propTypes = __webpack_require__(/*! prop-types */ 15); + + var _propTypes2 = _interopRequireDefault(_propTypes); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } + + function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } + + function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } + + /** + * Container for logout behaviour. + * @example + * + * + * + */ + var Logout = exports.Logout = function (_React$Component) { + _inherits(Logout, _React$Component); + + function Logout() { + var _ref; + + var _temp, _this, _ret; + + _classCallCheck(this, Logout); + + for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) { + args[_key] = arguments[_key]; + } + + return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Logout.__proto__ || Object.getPrototypeOf(Logout)).call.apply(_ref, [this].concat(args))), _this), _this.onClick = function (event) { + var store = _this.context.store; + + var state = store.getState(); + state.cognito.user.signOut(); + event.preventDefault(); + store.dispatch(_actions.Action.logout()); + _this.props.onLogout(); + }, _temp), _possibleConstructorReturn(_this, _ret); + } + + /** + * Passed to child element as onClick prop. + * Signs the user out, and then dispatches the logout action + * If you want to take further actions (like reloading UI) then add an + * onLogout property to the Logout element + */ + + + _createClass(Logout, [{ + key: 'render', + + + /** + * renders the child element, adding an onClick property + */ + value: function render() { + return _react2.default.cloneElement(this.props.children, { + onClick: this.onClick + }); + } + }]); + + return Logout; + }(_react2.default.Component); + + Logout.contextTypes = { + store: _propTypes2.default.object + }; + Logout.propTypes = { + children: _propTypes2.default.any.isRequired, + onLogout: _propTypes2.default.func + }; + Logout.defaultProps = { + onLogout: function onLogout() {} + }; + +/***/ }), +/* 15 */ +/*!*******************************!*\ + !*** ./~/prop-types/index.js ***! + \*******************************/ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + if (true) { + var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' && + Symbol.for && + Symbol.for('react.element')) || + 0xeac7; + + var isValidElement = function(object) { + return typeof object === 'object' && + object !== null && + object.$$typeof === REACT_ELEMENT_TYPE; + }; + + // By explicitly using `prop-types` you are opting into new development behavior. + // http://fb.me/prop-types-in-prod + var throwOnDirectAccess = true; + module.exports = __webpack_require__(/*! ./factoryWithTypeCheckers */ 16)(isValidElement, throwOnDirectAccess); + } else { + // By explicitly using `prop-types` you are opting into new production behavior. + // http://fb.me/prop-types-in-prod + module.exports = require('./factoryWithThrowingShims')(); + } + + +/***/ }), +/* 16 */ +/*!*************************************************!*\ + !*** ./~/prop-types/factoryWithTypeCheckers.js ***! + \*************************************************/ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(/*! fbjs/lib/emptyFunction */ 17); + var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 18); + var warning = __webpack_require__(/*! fbjs/lib/warning */ 19); + var assign = __webpack_require__(/*! object-assign */ 20); + + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ 21); + var checkPropTypes = __webpack_require__(/*! ./checkPropTypes */ 22); + + module.exports = function(isValidElement, throwOnDirectAccess) { + /* global Symbol */ + var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator; + var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec. + + /** + * Returns the iterator method function contained on the iterable object. + * + * Be sure to invoke the function with the iterable as context: + * + * var iteratorFn = getIteratorFn(myIterable); + * if (iteratorFn) { + * var iterator = iteratorFn.call(myIterable); + * ... + * } + * + * @param {?object} maybeIterable + * @return {?function} + */ + function getIteratorFn(maybeIterable) { + var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]); + if (typeof iteratorFn === 'function') { + return iteratorFn; + } + } + + /** + * Collection of methods that allow declaration and validation of props that are + * supplied to React components. Example usage: + * + * var Props = require('ReactPropTypes'); + * var MyArticle = React.createClass({ + * propTypes: { + * // An optional string prop named "description". + * description: Props.string, + * + * // A required enum prop named "category". + * category: Props.oneOf(['News','Photos']).isRequired, + * + * // A prop named "dialog" that requires an instance of Dialog. + * dialog: Props.instanceOf(Dialog).isRequired + * }, + * render: function() { ... } + * }); + * + * A more formal specification of how these methods are used: + * + * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...) + * decl := ReactPropTypes.{type}(.isRequired)? + * + * Each and every declaration produces a function with the same signature. This + * allows the creation of custom validation functions. For example: + * + * var MyLink = React.createClass({ + * propTypes: { + * // An optional string or URI prop named "href". + * href: function(props, propName, componentName) { + * var propValue = props[propName]; + * if (propValue != null && typeof propValue !== 'string' && + * !(propValue instanceof URI)) { + * return new Error( + * 'Expected a string or an URI for ' + propName + ' in ' + + * componentName + * ); + * } + * } + * }, + * render: function() {...} + * }); + * + * @internal + */ + + var ANONYMOUS = '<>'; + + // Important! + // Keep this list in sync with production version in `./factoryWithThrowingShims.js`. + var ReactPropTypes = { + array: createPrimitiveTypeChecker('array'), + bool: createPrimitiveTypeChecker('boolean'), + func: createPrimitiveTypeChecker('function'), + number: createPrimitiveTypeChecker('number'), + object: createPrimitiveTypeChecker('object'), + string: createPrimitiveTypeChecker('string'), + symbol: createPrimitiveTypeChecker('symbol'), + + any: createAnyTypeChecker(), + arrayOf: createArrayOfTypeChecker, + element: createElementTypeChecker(), + instanceOf: createInstanceTypeChecker, + node: createNodeChecker(), + objectOf: createObjectOfTypeChecker, + oneOf: createEnumTypeChecker, + oneOfType: createUnionTypeChecker, + shape: createShapeTypeChecker, + exact: createStrictShapeTypeChecker, + }; + + /** + * inlined Object.is polyfill to avoid requiring consumers ship their own + * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is + */ + /*eslint-disable no-self-compare*/ + function is(x, y) { + // SameValue algorithm + if (x === y) { + // Steps 1-5, 7-10 + // Steps 6.b-6.e: +0 != -0 + return x !== 0 || 1 / x === 1 / y; + } else { + // Step 6.a: NaN == NaN + return x !== x && y !== y; + } + } + /*eslint-enable no-self-compare*/ + + /** + * We use an Error-like object for backward compatibility as people may call + * PropTypes directly and inspect their output. However, we don't use real + * Errors anymore. We don't inspect their stack anyway, and creating them + * is prohibitively expensive if they are created too often, such as what + * happens in oneOfType() for any type before the one that matched. + */ + function PropTypeError(message) { + this.message = message; + this.stack = ''; + } + // Make `instanceof Error` still work for returned errors. + PropTypeError.prototype = Error.prototype; + + function createChainableTypeChecker(validate) { + if (true) { + var manualPropTypeCallCache = {}; + var manualPropTypeWarningCount = 0; + } + function checkType(isRequired, props, propName, componentName, location, propFullName, secret) { + componentName = componentName || ANONYMOUS; + propFullName = propFullName || propName; + + if (secret !== ReactPropTypesSecret) { + if (throwOnDirectAccess) { + // New behavior only for users of `prop-types` package + invariant( + false, + 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' + + 'Use `PropTypes.checkPropTypes()` to call them. ' + + 'Read more at http://fb.me/use-check-prop-types' + ); + } else if (("development") !== 'production' && typeof console !== 'undefined') { + // Old behavior for people using React.PropTypes + var cacheKey = componentName + ':' + propName; + if ( + !manualPropTypeCallCache[cacheKey] && + // Avoid spamming the console because they are often not actionable except for lib authors + manualPropTypeWarningCount < 3 + ) { + warning( + false, + 'You are manually calling a React.PropTypes validation ' + + 'function for the `%s` prop on `%s`. This is deprecated ' + + 'and will throw in the standalone `prop-types` package. ' + + 'You may be seeing this warning due to a third-party PropTypes ' + + 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.', + propFullName, + componentName + ); + manualPropTypeCallCache[cacheKey] = true; + manualPropTypeWarningCount++; + } + } + } + if (props[propName] == null) { + if (isRequired) { + if (props[propName] === null) { + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.')); + } + return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.')); + } + return null; + } else { + return validate(props, propName, componentName, location, propFullName); + } + } + + var chainedCheckType = checkType.bind(null, false); + chainedCheckType.isRequired = checkType.bind(null, true); + + return chainedCheckType; + } + + function createPrimitiveTypeChecker(expectedType) { + function validate(props, propName, componentName, location, propFullName, secret) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== expectedType) { + // `propValue` being instance of, say, date/regexp, pass the 'object' + // check, but we can offer a more precise error message here rather than + // 'of type `object`'. + var preciseType = getPreciseType(propValue); + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createAnyTypeChecker() { + return createChainableTypeChecker(emptyFunction.thatReturnsNull); + } + + function createArrayOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.'); + } + var propValue = props[propName]; + if (!Array.isArray(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.')); + } + for (var i = 0; i < propValue.length; i++) { + var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createElementTypeChecker() { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + if (!isValidElement(propValue)) { + var propType = getPropType(propValue); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createInstanceTypeChecker(expectedClass) { + function validate(props, propName, componentName, location, propFullName) { + if (!(props[propName] instanceof expectedClass)) { + var expectedClassName = expectedClass.name || ANONYMOUS; + var actualClassName = getClassName(props[propName]); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createEnumTypeChecker(expectedValues) { + if (!Array.isArray(expectedValues)) { + true ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + for (var i = 0; i < expectedValues.length; i++) { + if (is(propValue, expectedValues[i])) { + return null; + } + } + + var valuesString = JSON.stringify(expectedValues); + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.')); + } + return createChainableTypeChecker(validate); + } + + function createObjectOfTypeChecker(typeChecker) { + function validate(props, propName, componentName, location, propFullName) { + if (typeof typeChecker !== 'function') { + return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.'); + } + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.')); + } + for (var key in propValue) { + if (propValue.hasOwnProperty(key)) { + var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error instanceof Error) { + return error; + } + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createUnionTypeChecker(arrayOfTypeCheckers) { + if (!Array.isArray(arrayOfTypeCheckers)) { + true ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0; + return emptyFunction.thatReturnsNull; + } + + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (typeof checker !== 'function') { + warning( + false, + 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' + + 'received %s at index %s.', + getPostfixForTypeWarning(checker), + i + ); + return emptyFunction.thatReturnsNull; + } + } + + function validate(props, propName, componentName, location, propFullName) { + for (var i = 0; i < arrayOfTypeCheckers.length; i++) { + var checker = arrayOfTypeCheckers[i]; + if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) { + return null; + } + } + + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.')); + } + return createChainableTypeChecker(validate); + } + + function createNodeChecker() { + function validate(props, propName, componentName, location, propFullName) { + if (!isNode(props[propName])) { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.')); + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + for (var key in shapeTypes) { + var checker = shapeTypes[key]; + if (!checker) { + continue; + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + return createChainableTypeChecker(validate); + } + + function createStrictShapeTypeChecker(shapeTypes) { + function validate(props, propName, componentName, location, propFullName) { + var propValue = props[propName]; + var propType = getPropType(propValue); + if (propType !== 'object') { + return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.')); + } + // We need to check all keys in case some are required but missing from + // props. + var allKeys = assign({}, props[propName], shapeTypes); + for (var key in allKeys) { + var checker = shapeTypes[key]; + if (!checker) { + return new PropTypeError( + 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' + + '\nBad object: ' + JSON.stringify(props[propName], null, ' ') + + '\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ') + ); + } + var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret); + if (error) { + return error; + } + } + return null; + } + + return createChainableTypeChecker(validate); + } + + function isNode(propValue) { + switch (typeof propValue) { + case 'number': + case 'string': + case 'undefined': + return true; + case 'boolean': + return !propValue; + case 'object': + if (Array.isArray(propValue)) { + return propValue.every(isNode); + } + if (propValue === null || isValidElement(propValue)) { + return true; + } + + var iteratorFn = getIteratorFn(propValue); + if (iteratorFn) { + var iterator = iteratorFn.call(propValue); + var step; + if (iteratorFn !== propValue.entries) { + while (!(step = iterator.next()).done) { + if (!isNode(step.value)) { + return false; + } + } + } else { + // Iterator will provide entry [k,v] tuples rather than values. + while (!(step = iterator.next()).done) { + var entry = step.value; + if (entry) { + if (!isNode(entry[1])) { + return false; + } + } + } + } + } else { + return false; + } + + return true; + default: + return false; + } + } + + function isSymbol(propType, propValue) { + // Native Symbol. + if (propType === 'symbol') { + return true; + } + + // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol' + if (propValue['@@toStringTag'] === 'Symbol') { + return true; + } + + // Fallback for non-spec compliant Symbols which are polyfilled. + if (typeof Symbol === 'function' && propValue instanceof Symbol) { + return true; + } + + return false; + } + + // Equivalent of `typeof` but with special handling for array and regexp. + function getPropType(propValue) { + var propType = typeof propValue; + if (Array.isArray(propValue)) { + return 'array'; + } + if (propValue instanceof RegExp) { + // Old webkits (at least until Android 4.0) return 'function' rather than + // 'object' for typeof a RegExp. We'll normalize this here so that /bla/ + // passes PropTypes.object. + return 'object'; + } + if (isSymbol(propType, propValue)) { + return 'symbol'; + } + return propType; + } + + // This handles more types than `getPropType`. Only used for error messages. + // See `createPrimitiveTypeChecker`. + function getPreciseType(propValue) { + if (typeof propValue === 'undefined' || propValue === null) { + return '' + propValue; + } + var propType = getPropType(propValue); + if (propType === 'object') { + if (propValue instanceof Date) { + return 'date'; + } else if (propValue instanceof RegExp) { + return 'regexp'; + } + } + return propType; + } + + // Returns a string that is postfixed to a warning about an invalid type. + // For example, "undefined" or "of type array" + function getPostfixForTypeWarning(value) { + var type = getPreciseType(value); + switch (type) { + case 'array': + case 'object': + return 'an ' + type; + case 'boolean': + case 'date': + case 'regexp': + return 'a ' + type; + default: + return type; + } + } + + // Returns class name of the object, if any. + function getClassName(propValue) { + if (!propValue.constructor || !propValue.constructor.name) { + return ANONYMOUS; + } + return propValue.constructor.name; + } + + ReactPropTypes.checkPropTypes = checkPropTypes; + ReactPropTypes.PropTypes = ReactPropTypes; + + return ReactPropTypes; + }; + + +/***/ }), +/* 17 */ +/*!*************************************!*\ + !*** ./~/fbjs/lib/emptyFunction.js ***! + \*************************************/ +/***/ (function(module, exports) { + + "use strict"; + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * + */ + + function makeEmptyFunction(arg) { + return function () { + return arg; + }; + } + + /** + * This function accepts and discards inputs; it has no side effects. This is + * primarily useful idiomatically for overridable function endpoints which + * always need to be callable, since JS lacks a null-call idiom ala Cocoa. + */ + var emptyFunction = function emptyFunction() {}; + + emptyFunction.thatReturns = makeEmptyFunction; + emptyFunction.thatReturnsFalse = makeEmptyFunction(false); + emptyFunction.thatReturnsTrue = makeEmptyFunction(true); + emptyFunction.thatReturnsNull = makeEmptyFunction(null); + emptyFunction.thatReturnsThis = function () { + return this; + }; + emptyFunction.thatReturnsArgument = function (arg) { + return arg; + }; + + module.exports = emptyFunction; + +/***/ }), +/* 18 */ +/*!*********************************!*\ + !*** ./~/fbjs/lib/invariant.js ***! + \*********************************/ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + /** + * Use invariant() to assert state which your program assumes to be true. + * + * Provide sprintf-style format (only %s is supported) and arguments + * to provide information about what broke and what you were + * expecting. + * + * The invariant message will be stripped in production, but the invariant + * will remain to ensure logic does not differ in production. + */ + + var validateFormat = function validateFormat(format) {}; + + if (true) { + validateFormat = function validateFormat(format) { + if (format === undefined) { + throw new Error('invariant requires an error message argument'); + } + }; + } + + function invariant(condition, format, a, b, c, d, e, f) { + validateFormat(format); + + if (!condition) { + var error; + if (format === undefined) { + error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.'); + } else { + var args = [a, b, c, d, e, f]; + var argIndex = 0; + error = new Error(format.replace(/%s/g, function () { + return args[argIndex++]; + })); + error.name = 'Invariant Violation'; + } + + error.framesToPop = 1; // we don't care about invariant's own frame + throw error; + } + } + + module.exports = invariant; + +/***/ }), +/* 19 */ +/*!*******************************!*\ + !*** ./~/fbjs/lib/warning.js ***! + \*******************************/ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2014-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + */ + + 'use strict'; + + var emptyFunction = __webpack_require__(/*! ./emptyFunction */ 17); + + /** + * Similar to invariant but only logs a warning if the condition is not met. + * This can be used to log issues in development environments in critical + * paths. Removing the logging code for production environments will keep the + * same logic and follow the same code paths. + */ + + var warning = emptyFunction; + + if (true) { + var printWarning = function printWarning(format) { + for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) { + args[_key - 1] = arguments[_key]; + } + + var argIndex = 0; + var message = 'Warning: ' + format.replace(/%s/g, function () { + return args[argIndex++]; + }); + if (typeof console !== 'undefined') { + console.error(message); + } + try { + // --- Welcome to debugging React --- + // This error was thrown as a convenience so that you can use this stack + // to find the callsite that caused this warning to fire. + throw new Error(message); + } catch (x) {} + }; + + warning = function warning(condition, format) { + if (format === undefined) { + throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument'); + } + + if (format.indexOf('Failed Composite propType: ') === 0) { + return; // Ignore CompositeComponent proptype check. + } + + if (!condition) { + for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) { + args[_key2 - 2] = arguments[_key2]; + } + + printWarning.apply(undefined, [format].concat(args)); + } + }; + } + + module.exports = warning; + +/***/ }), +/* 20 */ +/*!**********************************!*\ + !*** ./~/object-assign/index.js ***! + \**********************************/ +/***/ (function(module, exports) { + + /* + object-assign + (c) Sindre Sorhus + @license MIT + */ + + 'use strict'; + /* eslint-disable no-unused-vars */ + var getOwnPropertySymbols = Object.getOwnPropertySymbols; + var hasOwnProperty = Object.prototype.hasOwnProperty; + var propIsEnumerable = Object.prototype.propertyIsEnumerable; + + function toObject(val) { + if (val === null || val === undefined) { + throw new TypeError('Object.assign cannot be called with null or undefined'); + } + + return Object(val); + } + + function shouldUseNative() { + try { + if (!Object.assign) { + return false; + } + + // Detect buggy property enumeration order in older V8 versions. + + // https://bugs.chromium.org/p/v8/issues/detail?id=4118 + var test1 = new String('abc'); // eslint-disable-line no-new-wrappers + test1[5] = 'de'; + if (Object.getOwnPropertyNames(test1)[0] === '5') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test2 = {}; + for (var i = 0; i < 10; i++) { + test2['_' + String.fromCharCode(i)] = i; + } + var order2 = Object.getOwnPropertyNames(test2).map(function (n) { + return test2[n]; + }); + if (order2.join('') !== '0123456789') { + return false; + } + + // https://bugs.chromium.org/p/v8/issues/detail?id=3056 + var test3 = {}; + 'abcdefghijklmnopqrst'.split('').forEach(function (letter) { + test3[letter] = letter; + }); + if (Object.keys(Object.assign({}, test3)).join('') !== + 'abcdefghijklmnopqrst') { + return false; + } + + return true; + } catch (err) { + // We don't expect any of the above to throw, but better to be safe. + return false; + } + } + + module.exports = shouldUseNative() ? Object.assign : function (target, source) { + var from; + var to = toObject(target); + var symbols; + + for (var s = 1; s < arguments.length; s++) { + from = Object(arguments[s]); + + for (var key in from) { + if (hasOwnProperty.call(from, key)) { + to[key] = from[key]; + } + } + + if (getOwnPropertySymbols) { + symbols = getOwnPropertySymbols(from); + for (var i = 0; i < symbols.length; i++) { + if (propIsEnumerable.call(from, symbols[i])) { + to[symbols[i]] = from[symbols[i]]; + } + } + } + } + + return to; + }; + + +/***/ }), +/* 21 */ +/*!**************************************************!*\ + !*** ./~/prop-types/lib/ReactPropTypesSecret.js ***! + \**************************************************/ +/***/ (function(module, exports) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + var ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'; + + module.exports = ReactPropTypesSecret; + + +/***/ }), +/* 22 */ +/*!****************************************!*\ + !*** ./~/prop-types/checkPropTypes.js ***! + \****************************************/ +/***/ (function(module, exports, __webpack_require__) { + + /** + * Copyright (c) 2013-present, Facebook, Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */ + + 'use strict'; + + if (true) { + var invariant = __webpack_require__(/*! fbjs/lib/invariant */ 18); + var warning = __webpack_require__(/*! fbjs/lib/warning */ 19); + var ReactPropTypesSecret = __webpack_require__(/*! ./lib/ReactPropTypesSecret */ 21); + var loggedTypeFailures = {}; + } + + /** + * Assert that the values match with the type specs. + * Error messages are memorized and will only be shown once. + * + * @param {object} typeSpecs Map of name to a ReactPropType + * @param {object} values Runtime values that need to be type-checked + * @param {string} location e.g. "prop", "context", "child context" + * @param {string} componentName Name of the component for error messages. + * @param {?Function} getStack Returns the component stack. + * @private + */ + function checkPropTypes(typeSpecs, values, location, componentName, getStack) { + if (true) { + for (var typeSpecName in typeSpecs) { + if (typeSpecs.hasOwnProperty(typeSpecName)) { + var error; + // Prop type validation may throw. In case they do, we don't want to + // fail the render phase where it didn't fail before. So we log it. + // After these have been cleaned up, we'll let them throw. + try { + // This is intentionally an invariant that gets caught. It's the same + // behavior as without this statement except with a better message. + invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]); + error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret); + } catch (ex) { + error = ex; + } + warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error); + if (error instanceof Error && !(error.message in loggedTypeFailures)) { + // Only monitor this failure once because there tends to be a lot of the + // same error. + loggedTypeFailures[error.message] = true; + + var stack = getStack ? getStack() : ''; + + warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : ''); + } + } + } + } + } + + module.exports = checkPropTypes; + + +/***/ }), +/* 23 */ +/*!*************************************!*\ + !*** ./src/NewPasswordRequired.jsx ***! + \*************************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.NewPasswordRequired = undefined; + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _reactRedux = __webpack_require__(/*! react-redux */ 13); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BaseNewPasswordRequired = function BaseNewPasswordRequired(props) { + return _react2.default.cloneElement(props.children, { + error: props.error, + onSubmit: props.onSubmit + }); + }; + + var setNewPassword = function setNewPassword(password, user, config, userAttributes, dispatch) { + return new Promise(function (resolve, reject) { + user.completeNewPasswordChallenge(password, userAttributes, { + onSuccess: function onSuccess() { + dispatch(_actions.Action.authenticated(user)); + resolve(); + }, + onFailure: function onFailure(error) { + dispatch(_actions.Action.newPasswordRequiredFailure(user, error.message)); + reject(error); + }, + mfaRequired: function mfaRequired() { + dispatch(_actions.Action.mfaRequired(user)); + resolve(); + }, + newPasswordRequired: function newPasswordRequired() { + dispatch(_actions.Action.newPasswordRequired(user)); + resolve(); + } + }); + }); + }; + + var mapStateToProps = function mapStateToProps(state) { + return { + error: state.cognito.error, + user: state.cognito.user, + config: state.cognito.config + }; + }; + + var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + setNewPasswordPartial: function setNewPasswordPartial(password, user, config, userAttributes) { + return setNewPassword(password, user, config, userAttributes, dispatch); + } + }; + }; + + var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { + return Object.assign({}, ownProps, stateProps, { + onSubmit: function onSubmit(password, userAttributes) { + return dispatchProps.setNewPasswordPartial(password, stateProps.user, stateProps.config, userAttributes); + } + }); + }; + + /** + * Wrapper for a New Password Required form + * + * Magically provides the following props to the wrapped element: + * + * * user - the Cognito user + * * error - the persistent react-cognito error message + * * onSubmit - a handler that calls the Set New Password API + * + * @example + * + * + * + * + */ + var NewPasswordRequired = exports.NewPasswordRequired = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseNewPasswordRequired); + +/***/ }), +/* 24 */ +/*!***********************************!*\ + !*** ./src/EmailVerification.jsx ***! + \***********************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.EmailVerification = exports.verifyEmail = undefined; + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _reactRedux = __webpack_require__(/*! react-redux */ 13); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BaseEmailVerification = function BaseEmailVerification(props) { + return _react2.default.cloneElement(props.children, { + error: props.error, + onSubmit: props.onSubmit, + onCancel: props.onCancel + }); + }; + + var verifyEmail = exports.verifyEmail = function verifyEmail(verificationCode, user, dispatch) { + return new Promise(function (resolve, reject) { + user.verifyAttribute('email', verificationCode, { + onSuccess: function onSuccess() { + dispatch(_actions.Action.login(user)); + resolve(); + }, + inputVerificationCode: function inputVerificationCode() { + dispatch(_actions.Action.emailVerificationRequired(user)); + reject(); + }, + onFailure: function onFailure(error) { + dispatch(_actions.Action.emailVerificationFailed(user, error.message)); + reject(); + } + }); + }); + }; + + var mapStateToProps = function mapStateToProps(state) { + return { + error: state.cognito.error, + user: state.cognito.user + }; + }; + + var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + verifyPartial: function verifyPartial(verificationCode, user) { + return verifyEmail(verificationCode, user, dispatch); + }, + onCancel: function onCancel() { + return dispatch(_actions.Action.logout()); + } + }; + }; + + var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { + return Object.assign({}, ownProps, stateProps, dispatchProps, { + onSubmit: function onSubmit(verificationCode) { + return dispatchProps.verifyPartial(verificationCode, stateProps.user); + } + }); + }; + + /** + * Wrapper for an Email Verification Form. + * Magically adds the following props to the contained form: + * + * * user - the Cognito user from the Redux store + * * error - the persisted error from the Redux store + * * onSubmit - a handler that calls the Cognito verification API + * + * @example + * + * + * + * + */ + var EmailVerification = exports.EmailVerification = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseEmailVerification); + +/***/ }), +/* 25 */ +/*!*******************************!*\ + !*** ./src/PasswordReset.jsx ***! + \*******************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.PasswordReset = undefined; + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _reactRedux = __webpack_require__(/*! react-redux */ 13); + + var _amazonCognitoIdentityJs = __webpack_require__(/*! amazon-cognito-identity-js */ 2); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BasePasswordReset = function BasePasswordReset(props) { + return _react2.default.cloneElement(props.children, { + username: props.username, + sendVerificationCode: props.sendVerificationCode, + setPassword: props.setPassword + }); + }; + + var getUser = function getUser(username, userPool) { + var user = new _amazonCognitoIdentityJs.CognitoUser({ + Username: username, + Pool: userPool + }); + return user; + }; + + var setPassword = function setPassword(username, userPool, code, password, dispatch) { + return new Promise(function (resolve, reject) { + var user = getUser(username, userPool); + user.confirmPassword(code, password, { + onSuccess: function onSuccess() { + dispatch(_actions.Action.finishPasswordResetFlow()), resolve(); + }, + onFailure: function onFailure(err) { + dispatch(_actions.Action.beginPasswordResetFlow(user, err.message)), reject(err); + } + }); + }); + }; + + var sendVerificationCode = function sendVerificationCode(username, userPool, dispatch) { + return new Promise(function (resolve, reject) { + var user = getUser(username, userPool); + user.forgotPassword({ + onSuccess: function onSuccess() { + dispatch(_actions.Action.continuePasswordResetFlow(user)); + resolve(); + }, + onFailure: function onFailure(err) { + dispatch(_actions.Action.beginPasswordResetFlow(user, err.message)); + reject(err); + } + }); + }); + }; + + var mapStateToProps = function mapStateToProps(state) { + var props = { + user: state.cognito.user, + username: '', + userPool: state.cognito.userPool + }; + if (state.cognito.user != null) { + props.username = state.cognito.user.getUsername(); + } + return props; + }; + + var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + sendVerificationCodePartial: function sendVerificationCodePartial(username, userPool) { + return sendVerificationCode(username, userPool, dispatch); + }, + setPasswordPartial: function setPasswordPartial(user, userPool, code, password) { + return setPassword(user, userPool, code, password, dispatch); + } + }; + }; + + var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { + return Object.assign({}, ownProps, stateProps, { + sendVerificationCode: function sendVerificationCode(username) { + return dispatchProps.sendVerificationCodePartial(username, stateProps.userPool); + }, + setPassword: function setPassword(username, code, password) { + return dispatchProps.setPasswordPartial(username, stateProps.userPool, code, password); + } + }); + }; + + /** + * Container for a Password Reset form + * + * Magically provides the following props to the wrapped element: + * + * * user + * * username + * * sendVerificationCode + * * setPassword + * + * @example + * + * + * + */ + var PasswordReset = exports.PasswordReset = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BasePasswordReset); + +/***/ }), +/* 26 */ +/*!*************************!*\ + !*** ./src/Confirm.jsx ***! + \*************************/ +/***/ (function(module, exports, __webpack_require__) { + + 'use strict'; + + Object.defineProperty(exports, "__esModule", { + value: true + }); + exports.Confirm = undefined; + + var _react = __webpack_require__(/*! react */ 12); + + var _react2 = _interopRequireDefault(_react); + + var _reactRedux = __webpack_require__(/*! react-redux */ 13); + + var _actions = __webpack_require__(/*! ./actions */ 4); + + function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } + + var BaseConfirm = function BaseConfirm(props) { + return _react2.default.cloneElement(props.children, { + error: props.error, + onSubmit: props.onSubmit, + onResend: props.onResend, + onCancel: props.onCancel + }); + }; + + var confirm = function confirm(verificationCode, user, dispatch) { + return new Promise(function (resolve, reject) { + user.confirmRegistration(verificationCode, true, function (error) { + if (error) { + dispatch(_actions.Action.confirmFailed(user)); + reject(error.message); + } else { + dispatch(_actions.Action.partialLogout()); + resolve(user); + } + }); + }); + }; + + var resend = function resend(user, dispatch) { + return new Promise(function (resolve, reject) { + user.resendConfirmationCode(function (err) { + if (err) { + dispatch(_actions.Action.confirmationRequired(user)); + reject(err.message); + } else { + dispatch(_actions.Action.confirmationRequired(user)); + resolve(user); + } + }); + }); + }; + + var mapStateToProps = function mapStateToProps(state) { + return { + error: state.cognito.error, + user: state.cognito.user + }; + }; + + var mapDispatchToProps = function mapDispatchToProps(dispatch) { + return { + confirmPartial: function confirmPartial(verificationCode, user) { + return confirm(verificationCode, user, dispatch); + }, + onCancel: function onCancel() { + return dispatch(_actions.Action.logout()); + }, + onResendPartial: function onResendPartial(user) { + return resend(user, dispatch); + } + }; + }; + + var mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) { + return Object.assign({}, ownProps, stateProps, dispatchProps, { + onSubmit: function onSubmit(verificationCode) { + return dispatchProps.confirmPartial(verificationCode, stateProps.user); + }, + onResend: function onResend() { + return dispatchProps.onResendPartial(stateProps.user); + } + }); + }; + + /** + * Container for a confirmation form. Magically adds the following props to the + * contained form: + * + * * user - the Cognito User from the redux store + * * error - the persisted error from the redux store + * * onSubmit - a handler that calls the Cognito confirm API + * * onResend - a handler that calls the Cognito resend request API + * * onCancel - Logs the user out completely + * + * @example + * + * + * + * + */ + var Confirm = exports.Confirm = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseConfirm); + +/***/ }) +/******/ ]) +}); +; +//# sourceMappingURL=react-cognito.js.map \ No newline at end of file diff --git a/dist/react-cognito.js.map b/dist/react-cognito.js.map new file mode 100644 index 0000000..c713792 --- /dev/null +++ b/dist/react-cognito.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///webpack/bootstrap b4d8cdc38dea08b8c396","webpack:///./src/index.js","webpack:///./src/reducers.js","webpack:///external {\"root\":\"AmazonCognitoIdentity\",\"commonjs2\":\"amazon-cognito-identity-js\",\"commonjs\":\"amazon-cognito-identity-js\",\"amd\":\"amazon-cognito-identity-js\"}","webpack:///./src/states.js","webpack:///./src/actions.js","webpack:///./src/utils.js","webpack:///external \"aws-sdk/global\"","webpack:///./src/guard.js","webpack:///./src/auth.js","webpack:///./src/attributes.js","webpack:///./src/policy.js","webpack:///./src/Login.jsx","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///external {\"root\":\"ReactRedux\",\"commonjs\":\"react-redux\",\"commonjs2\":\"react-redux\",\"amd\":\"react-redux\"}","webpack:///./src/Logout.jsx","webpack:///./~/prop-types/index.js","webpack:///./~/prop-types/factoryWithTypeCheckers.js","webpack:///./~/fbjs/lib/emptyFunction.js","webpack:///./~/fbjs/lib/invariant.js","webpack:///./~/fbjs/lib/warning.js","webpack:///./~/object-assign/index.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js","webpack:///./~/prop-types/checkPropTypes.js","webpack:///./src/NewPasswordRequired.jsx","webpack:///./src/EmailVerification.jsx","webpack:///./src/PasswordReset.jsx","webpack:///./src/Confirm.jsx"],"names":["initial","user","cache","userName","email","state","LOGGED_OUT","error","userPool","attributes","creds","groups","config","region","clientId","identityPool","configure","action","AWS","pool","UserPoolId","ClientId","getCurrentUser","Object","assign","addAttributes","s","s2","cognito","type","AUTHENTICATED","LOGGING_IN","LOGGED_IN","username","MFA_REQUIRED","NEW_PASSWORD_REQUIRED","CONFIRMATION_REQUIRED","EMAIL_VERIFICATION_REQUIRED","CognitoState","Action","authenticated","loggingIn","login","logout","partialLogout","loginFailure","mfaRequired","newPasswordRequired","newPasswordRequiredFailure","emailVerificationRequired","emailVerificationFailed","beginPasswordResetFlow","continuePasswordResetFlow","finishPasswordResetFlow","updateAttributes","confirmationRequired","confirmFailed","clearCache","changePassword","oldPassword","newPassword","Promise","resolve","reject","err","result","message","buildLogins","jwtToken","loginDomain","loginUrl","IdentityPoolId","Logins","LoginId","getGroups","payload","split","decodedToken","JSON","parse","base64","decode","toString","testLoggedIn","wantLoggedIn","isLoggedIn","permitted","expr","loggedIn","undefined","guard","store","forbiddenUrl","routeState","replace","callback","getState","dest","then","allow","createGuard","emailVerificationFlow","required","refreshIdentityCredentials","logins","refresh","performLogin","group","getSession","session","getIdToken","getJwtToken","includes","getUsername","authenticate","password","dispatch","Username","Password","Pool","authenticateUser","onSuccess","onFailure","code","registerUser","signUp","userConfirmed","sendAttributeVerificationCode","attribute","getAttributeVerificationCode","inputVerificationCode","getUserAttributes","i","length","name","getName","value","getValue","mkAttrList","keys","map","Name","key","Value","attributeList","enable","f","params","subscribe","email_verified","fetchAttributes","direct","identityPoolLogin","setupCognito","listeners","forEach","BaseLogin","cloneElement","props","children","onSubmit","mapStateToProps","mapDispatchToProps","authenticator","mergeProps","stateProps","dispatchProps","ownProps","Login","Logout","onClick","event","context","signOut","preventDefault","onLogout","Component","contextTypes","object","propTypes","any","isRequired","func","defaultProps","BaseNewPasswordRequired","setNewPassword","userAttributes","completeNewPasswordChallenge","setNewPasswordPartial","NewPasswordRequired","BaseEmailVerification","onCancel","verifyEmail","verificationCode","verifyAttribute","verifyPartial","EmailVerification","BasePasswordReset","sendVerificationCode","setPassword","getUser","confirmPassword","forgotPassword","sendVerificationCodePartial","setPasswordPartial","PasswordReset","BaseConfirm","onResend","confirm","confirmRegistration","resend","resendConfirmationCode","confirmPartial","onResendPartial","Confirm"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD,O;ACVA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,uBAAe;AACf;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;ACtCA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AACA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;;AACA;AAAA;AAAA;AAAA;AA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;AAGAT,QAAOU,SAAP,GAAmB;AACjBpB,aAAU,oBAAUqB,GAAV,CAAcC,UADP;AAEjBN,aAAU,oBAAUO;AAFH,EAAnB;AAIAb,QAAOc,YAAP,GAAsB;AACpBR,aAAU,oBAAM,CAAE;AADE,EAAtB,C;;;;;;;;;AC5CA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,EAAC;AACD;AACA;AACA;AACA;;;;;;;;;;AC3BA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,2CAA0C;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAa,QAAQ;AACrB,eAAc;AACd;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,WAAU;AACV,8BAA6B;AAC7B,SAAQ;AACR;AACA;AACA;AACA;AACA,gCAA+B,KAAK;AACpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT,6BAA4B;AAC5B,QAAO;AACP;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sBAAqB,sBAAsB;AAC3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,sBAAqB,2BAA2B;AAChD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA,oBAAmB,gCAAgC;AACnD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA,sBAAqB,gCAAgC;AACrD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAW;AACX;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,UAAS;AACT;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;;;;;;;;AC7hBA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,8CAA6C;AAC7C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,gC;;;;;;;;;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,sDAAqD;AACrD,MAAK;AACL;AACA;AACA;AACA;AACA,QAAO;AACP;AACA;;AAEA,2BAA0B;AAC1B;AACA;AACA;;AAEA,4B;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA,uFAAsF,aAAa;AACnG;AACA;;AAEA;AACA;AACA;AACA,MAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAK;AACL;;AAEA;AACA;AACA;AACA;;AAEA;AACA,cAAa;AACb;;AAEA;AACA,6FAA4F,eAAe;AAC3G;AACA;;AAEA;AACA;AACA;AACA;;AAEA,0B;;;;;;;;;AC7DA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA,iCAAgC;AAChC;AACA;AACA;AACA;;AAEA;AACA;AACA,kBAAiB,QAAQ;AACzB;AACA;AACA;AACA;AACA,IAAG;AACH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,IAAG;AACH,mCAAkC;AAClC;AACA;AACA;;AAEA;AACA,GAAE;AACF;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,iBAAgB,sBAAsB;AACtC;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAkB,oBAAoB;AACtC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;;;;;;;;;ACzFA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;;AAEA;;;;;;;;;;ACXA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,OAAO;AAClB,YAAW,UAAU;AACrB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iGAAgG;AAChG;AACA,UAAS;AACT;AACA;AACA,iGAAgG;AAChG;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;;;;;;;;;;;;;;;;AC1DA;;;;AACA;;AACA;;;;AAEA,KAAMS,0BAA0B,SAA1BA,uBAA0B;AAAA,UAC9B,gBAAM3B,YAAN,CAAmBC,MAAMC,QAAz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HD,MAGO;AACLkD,kBAAS,gBAAO7D,oBAAP,CAA4BtD,IAA5B,CAAT;AACA6D,iBAAQ7D,IAAR;AACD;AACF,MARD;AASD,IAVD,CADa;AAAA,EAAf;;AAaA,KAAMgK,kBAAkB,SAAlBA,eAAkB;AAAA,UAAU;AAChC1J,YAAOF,MAAMuB,OAAN,CAAcrB,KADW;AAEhCN,WAAMI,MAAMuB,OAAN,CAAc3B;AAFY,IAAV;AAAA,EAAxB;;AAKA,KAAMiK,qBAAqB,SAArBA,kBAAqB;AAAA,UAAa;AACtCkD,qBAAgB,wBAACnB,gBAAD,EAAmBhM,IAAnB;AAAA,cACd+M,QAAQf,gBAAR,EAA0BhM,IAA1B,EAAgCmH,QAAhC,CADc;AAAA,MADsB;AAGtC2E,eAAU;AAAA,cAAM3E,SAAS,gBAAOzE,MAAP,EAAT,CAAN;AAAA,MAH4B;AAItC0K,sBAAiB;AAAA,cAAQH,OAAOjN,IAAP,EAAamH,QAAb,CAAR;AAAA;AAJqB,IAAb;AAAA,EAA3B;;AAOA,KAAMgD,aAAa,SAAbA,UAAa,CAACC,UAAD,EAAaC,aAAb,EAA4BC,QAA5B;AAAA,UACjBhJ,OAAOC,MAAP,CAAc,EAAd,EAAkB+I,QAAlB,EAA4BF,UAA5B,EAAwCC,aAAxC,EAAuD;AACrDN,eAAU;AAAA,cACTM,cAAc8C,cAAd,CAA6BnB,gBAA7B,EAA+C5B,WAAWpK,IAA1D,CADS;AAAA,MAD2C;AAGrD8M,eAAU;AAAA,cACTzC,cAAc+C,eAAd,CAA8BhD,WAAWpK,IAAzC,CADS;AAAA;AAH2C,IAAvD,CADiB;AAAA,EAAnB;;AAQA;;;;;;;;;;;;;;;;AAgBO,KAAMqN,4BAAU,yBACrBrD,eADqB,EAErBC,kBAFqB,EAGrBE,UAHqB,EAIrB0C,WAJqB,CAAhB,C","file":"react-cognito.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"), require(\"react\"), require(\"react-redux\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"amazon-cognito-identity-js\", \"aws-sdk/global\", \"react\", \"react-redux\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactCognito\"] = factory(require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"), require(\"react\"), require(\"react-redux\"));\n\telse\n\t\troot[\"ReactCognito\"] = factory(root[\"AmazonCognitoIdentity\"], root[\"aws-sdk/global\"], root[\"React\"], root[\"ReactRedux\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_6__, __WEBPACK_EXTERNAL_MODULE_12__, __WEBPACK_EXTERNAL_MODULE_13__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap b4d8cdc38dea08b8c396","export * from './reducers';\r\nexport * from './actions';\r\nexport * from './states';\r\nexport * from './utils';\r\nexport * from './guard';\r\nexport * from './auth';\r\nexport * from './attributes';\r\nexport * from './policy';\r\n\r\n\r\nexport * from './Login.jsx';\r\nexport * from './Logout.jsx';\r\nexport * from './NewPasswordRequired.jsx';\r\nexport * from './EmailVerification.jsx';\r\nexport * from './PasswordReset.jsx';\r\nexport * from './Confirm.jsx';\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","import { CognitoUserPool } from 'amazon-cognito-identity-js';\r\nimport { CognitoState } from './states';\r\n\r\n/* global AWS */\r\n\r\nconst initial = {\r\n user: null,\r\n cache: { // cached for post register login\r\n userName: null,\r\n email: null,\r\n },\r\n state: CognitoState.LOGGED_OUT,\r\n error: '',\r\n userPool: null,\r\n attributes: {},\r\n creds: null,\r\n groups: [],\r\n config: {\r\n region: null,\r\n userPool: null,\r\n clientId: null,\r\n identityPool: null,\r\n },\r\n};\r\n\r\nconst configure = (state, action) => {\r\n // surprise side-effect!\r\n AWS.config.region = action.config.region;\r\n const pool = new CognitoUserPool({\r\n UserPoolId: action.config.userPool,\r\n ClientId: action.config.clientId,\r\n });\r\n const user = pool.getCurrentUser();\r\n return Object.assign({}, state, {\r\n config: action.config,\r\n userPool: pool,\r\n user,\r\n });\r\n};\r\n\r\n// sometimes we don't get the attributes in later parts of the login flow\r\n// but lets not clobber the ones we've got if we've not got them\r\nconst addAttributes = (s, attributes) => {\r\n const s2 = Object.assign({}, s);\r\n if (attributes) {\r\n s2.attributes = attributes;\r\n }\r\n return s2;\r\n};\r\n\r\n/**\r\n * reducer function to be passed to redux combineReducers\r\n * @param {object} state\r\n * @param {object} action\r\n*/\r\n\r\nexport const cognito = (state = initial, action) => {\r\n switch (action.type) {\r\n\r\n case 'COGNITO_CONFIGURE':\r\n return configure(state, action);\r\n\r\n case 'COGNITO_AUTHENTICATED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n cache: {\r\n userName: null,\r\n email: null,\r\n },\r\n error: '',\r\n state: CognitoState.AUTHENTICATED,\r\n });\r\n\r\n case 'COGNITO_CLEAR_CACHE':\r\n return Object.assign({}, state, {\r\n cache: {\r\n userName: null,\r\n email: null,\r\n },\r\n });\r\n\r\n case 'COGNITO_LOGGING_IN':\r\n return Object.assign({}, state, {\r\n state: CognitoState.LOGGING_IN,\r\n attributes: action.attributes,\r\n });\r\n\r\n case 'COGNITO_LOGIN':\r\n return Object.assign({}, state, addAttributes({\r\n error: '',\r\n creds: action.creds,\r\n groups: action.groups,\r\n state: CognitoState.LOGGED_IN,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_LOGOUT':\r\n return Object.assign({}, state, {\r\n user: null,\r\n attributes: {},\r\n error: '',\r\n creds: null,\r\n groups: [],\r\n state: CognitoState.LOGGED_OUT,\r\n });\r\n\r\n case 'COGNITO_PARTIAL_LOGOUT':\r\n return Object.assign({}, state, {\r\n user: null,\r\n userName: state.user.username,\r\n error: '',\r\n creds: null,\r\n groups: [],\r\n state: CognitoState.LOGGED_OUT,\r\n });\r\n\r\n case 'COGNITO_LOGIN_FAILURE':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.LOGGED_OUT,\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_LOGIN_MFA_REQUIRED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n error: '',\r\n state: CognitoState.MFA_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n error: '',\r\n state: CognitoState.NEW_PASSWORD_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_USER_UNCONFIRMED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.CONFIRMATION_REQUIRED,\r\n cache: {\r\n userName: action.user.username,\r\n email: action.email ? action.email : state.cache.email,\r\n },\r\n });\r\n\r\n case 'COGNITO_USER_CONFIRM_FAILED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.CONFIRMATION_REQUIRED,\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE':\r\n return Object.assign({}, state, {\r\n error: action.error,\r\n state: CognitoState.NEW_PASSWORD_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_EMAIL_VERIFICATION_REQUIRED':\r\n return Object.assign({}, state, addAttributes({\r\n error: '',\r\n state: CognitoState.EMAIL_VERIFICATION_REQUIRED,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_EMAIL_VERIFICATION_FAILED':\r\n return Object.assign({}, state, addAttributes({\r\n error: action.error,\r\n state: CognitoState.EMAIL_VERIFICATION_REQUIRED,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_BEGIN_PASSWORD_RESET_FLOW':\r\n return Object.assign({}, state, {\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW':\r\n return state;\r\n\r\n case 'COGNITO_FINISH_PASSWORD_RESET_FLOW':\r\n return state;\r\n\r\n // this moves us into the AUTHENTICATED state, potentially causing\r\n // a number of side-effects. this is so we can re-verify the email\r\n // address if we have to\r\n case 'COGNITO_UPDATE_USER_ATTRIBUTES':\r\n return Object.assign({}, state, {\r\n attributes: Object.assign({}, state.attributes, action.attributes),\r\n state: CognitoState.AUTHENTICATED,\r\n });\r\n\r\n default:\r\n return state;\r\n }\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/reducers.js","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"AmazonCognitoIdentity\",\"commonjs2\":\"amazon-cognito-identity-js\",\"commonjs\":\"amazon-cognito-identity-js\",\"amd\":\"amazon-cognito-identity-js\"}\n// module id = 2\n// module chunks = 0","\r\n/** states stored in store.cognito.state */\r\nexport const CognitoState = {\r\n LOGGED_OUT: 'LOGGED_OUT',\r\n AUTHENTICATED: 'AUTHENTICATED',\r\n LOGGING_IN: 'LOGGING_IN',\r\n LOGGED_IN: 'LOGGED_IN',\r\n NEW_PASSWORD_REQUIRED: 'NEW_PASSWORD_REQUIRED',\r\n MFA_REQUIRED: 'MFA_REQUIRED',\r\n EMAIL_VERIFICATION_REQUIRED: 'EMAIL_VERIFICATION_REQUIRED',\r\n CONFIRMATION_REQUIRED: 'CONFIRMATION_REQUIRED',\r\n};\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/states.js","/**\r\n * container for all the actions\r\n*/\r\nconst Action = {\r\n\r\n configure: config => ({\r\n type: 'COGNITO_CONFIGURE',\r\n config,\r\n }),\r\n\r\n authenticated: user => ({\r\n type: 'COGNITO_AUTHENTICATED',\r\n user,\r\n }),\r\n\r\n loggingIn: attributes => ({\r\n type: 'COGNITO_LOGGING_IN',\r\n attributes,\r\n }),\r\n\r\n login: (creds, attributes, groups) => ({\r\n type: 'COGNITO_LOGIN',\r\n creds,\r\n groups,\r\n attributes,\r\n }),\r\n\r\n logout: () => ({\r\n type: 'COGNITO_LOGOUT',\r\n }),\r\n\r\n partialLogout: () => ({\r\n type: 'COGNITO_PARTIAL_LOGOUT',\r\n }),\r\n\r\n loginFailure: (user, error) => ({\r\n type: 'COGNITO_LOGIN_FAILURE',\r\n user,\r\n error,\r\n }),\r\n\r\n mfaRequired: user => ({\r\n type: 'COGNITO_LOGIN_MFA_REQUIRED',\r\n user,\r\n }),\r\n\r\n newPasswordRequired: user => ({\r\n type: 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED',\r\n user,\r\n }),\r\n\r\n newPasswordRequiredFailure: (user, error) => ({\r\n type: 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE',\r\n user,\r\n error,\r\n }),\r\n\r\n emailVerificationRequired: attributes => ({\r\n type: 'COGNITO_EMAIL_VERIFICATION_REQUIRED',\r\n attributes,\r\n }),\r\n\r\n emailVerificationFailed: (user, error) => ({\r\n type: 'COGNITO_EMAIL_VERIFICATION_FAILED',\r\n user,\r\n error,\r\n }),\r\n\r\n beginPasswordResetFlow: (user, error) => ({\r\n type: 'COGNITO_BEGIN_PASSWORD_RESET_FLOW',\r\n user,\r\n error,\r\n }),\r\n\r\n continuePasswordResetFlow: user => ({\r\n type: 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW',\r\n user,\r\n }),\r\n\r\n finishPasswordResetFlow: error => ({\r\n type: 'COGNITO_FINISH_PASSWORD_RESET_FLOW',\r\n error,\r\n }),\r\n\r\n updateAttributes: attributes => ({\r\n type: 'COGNITO_UPDATE_USER_ATTRIBUTES',\r\n attributes,\r\n }),\r\n\r\n confirmationRequired: (user, email) => ({\r\n type: 'COGNITO_USER_UNCONFIRMED',\r\n user,\r\n email,\r\n }),\r\n\r\n confirmFailed: (user, error) => ({\r\n type: 'COGNITO_USER_CONFIRM_FAILED',\r\n user,\r\n error,\r\n }),\r\n\r\n clearCache: () => ({\r\n type: 'COGNITO_CLEAR_CACHE',\r\n }),\r\n};\r\n\r\nexport { Action };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/actions.js","import { util as AWSutil } from 'aws-sdk/global';\r\n\r\n/**\r\n * Change a user's password\r\n * @param {object} user - the cognito user object\r\n * @param {string} oldPassword - the current password\r\n * @param {string} newPassword - the new password\r\n*/\r\nconst changePassword = (user, oldPassword, newPassword) =>\r\n new Promise((resolve, reject) =>\r\n user.changePassword(oldPassword, newPassword, (err, result) => {\r\n if (err) {\r\n reject(err.message);\r\n } else {\r\n resolve(result);\r\n }\r\n }));\r\n\r\n/**\r\n * builds the federated identity pool login structure\r\n * @param {string} username - the username of the user\r\n * @param {string} jwtToken - a JWT Token from the session\r\n * @param {object} config - the cognito react config object\r\n*/\r\nconst buildLogins = (username, jwtToken, config) => {\r\n const loginDomain = `cognito-idp.${config.region}.amazonaws.com`;\r\n const loginUrl = `${loginDomain}/${config.userPool}`;\r\n const creds = {\r\n IdentityPoolId: config.identityPool,\r\n Logins: {},\r\n LoginId: username, // https://github.com/aws/aws-sdk-js/issues/609\r\n };\r\n creds.Logins[loginUrl] = jwtToken;\r\n return creds;\r\n};\r\n\r\n/**\r\n * Decode a jwtToken to check for cognito:groups\r\n * @param {string} jwtToken - a JWT Token from the session\r\n */\r\nconst getGroups = (jwtToken) => {\r\n const payload = jwtToken.split('.')[1];\r\n const decodedToken = JSON.parse(AWSutil.base64.decode(payload).toString('utf8'));\r\n // decodedToken['cognito:groups'] can be undefined if user is in no groups\r\n if (!decodedToken['cognito:groups']) {\r\n return [];\r\n }\r\n return decodedToken['cognito:groups'];\r\n};\r\n\r\nexport {\r\n changePassword,\r\n buildLogins,\r\n getGroups,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","module.exports = __WEBPACK_EXTERNAL_MODULE_6__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"aws-sdk/global\"\n// module id = 6\n// module chunks = 0","\r\n/*\r\n Default behaviour is to restrict access to only logged in users\r\n*/\r\n\r\nconst testLoggedIn = (state, wantLoggedIn) => {\r\n const isLoggedIn = state.cognito.user !== null;\r\n if (isLoggedIn && wantLoggedIn) {\r\n return true;\r\n }\r\n if (!isLoggedIn && !wantLoggedIn) {\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nconst permitted = (state, expr) =>\r\n new Promise((resolve) => {\r\n if (expr.loggedIn !== undefined) {\r\n resolve(testLoggedIn(state, expr.loggedIn));\r\n } else {\r\n resolve(testLoggedIn(state, true));\r\n }\r\n });\r\n\r\nconst guard = (store, forbiddenUrl, expr = {}, routeState, replace, callback) => {\r\n const state = store.getState();\r\n let dest = forbiddenUrl;\r\n\r\n if (expr.forbiddenUrl !== undefined) {\r\n dest = expr.forbiddenUrl;\r\n }\r\n permitted(state, expr).then((allow) => {\r\n if (!allow) {\r\n replace(dest);\r\n }\r\n callback();\r\n });\r\n};\r\n\r\n/**\r\n * creates a guard function you can use in tags\r\n * @param {object} store - the redux store\r\n * @param {string} forbiddenUrl - the default url to navigate to if forbidden\r\n * @returns {function} - a function that can be provided to onEnter\r\n*/\r\nconst createGuard = (store, forbiddenUrl) => expr => (state, replace, callback) =>\r\n guard(store, forbiddenUrl, expr, state, replace, callback);\r\n\r\n\r\nexport { createGuard };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/guard.js","import { CognitoUser, AuthenticationDetails } from 'amazon-cognito-identity-js';\r\nimport { CognitoIdentityCredentials } from 'aws-sdk/global';\r\nimport { Action } from './actions';\r\nimport { getUserAttributes, mkAttrList, sendAttributeVerificationCode } from './attributes';\r\nimport { buildLogins, getGroups } from './utils';\r\n\r\n/**\r\n * sends the email verification code and transitions to the correct state\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} attributes - the attributes dictionary\r\n * @return {Promise} a promise that resolves to a redux action\r\n*/\r\nconst emailVerificationFlow = (user, attributes) =>\r\n new Promise(resolve =>\r\n sendAttributeVerificationCode(user, 'email').then((required) => {\r\n if (required) {\r\n resolve(Action.emailVerificationRequired(attributes));\r\n } else {\r\n // dead end?\r\n resolve(Action.loggingIn(attributes));\r\n }\r\n }, (error) => {\r\n // some odd classes of error here\r\n resolve(Action.emailVerificationFailed(error, attributes));\r\n }));\r\n\r\n/**\r\n * logs in to the federated identity pool with a JWT\r\n * @param {string} username - the username\r\n * @param {string} jwtToken - a token from the session\r\n * @param {object} config - the react-cognito config\r\n * @return {Promise} a promise that resolves to the federated identity credentials\r\n*/\r\nconst refreshIdentityCredentials = (username, jwtToken, config) =>\r\n new Promise((resolve, reject) => {\r\n const logins = buildLogins(username, jwtToken, config);\r\n const creds = new CognitoIdentityCredentials(logins, { region: config.region });\r\n creds.refresh((error) => {\r\n if (error) {\r\n reject(error.message);\r\n } else {\r\n resolve(creds);\r\n }\r\n });\r\n });\r\n\r\n/**\r\n * establishes a session with the user pool, and optionally logs into the federated identity\r\n * pool using a token from the session.\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} config -the react-cognito config\r\n * @return {Promise} an action to be dispatched\r\n*/\r\nconst performLogin = (user, config, group) =>\r\n new Promise((resolve, reject) => {\r\n if (user === null) {\r\n resolve(Action.logout());\r\n } else {\r\n user.getSession((err, session) => {\r\n if (err) {\r\n resolve(Action.loginFailure(user, err.message));\r\n } else {\r\n const jwtToken = session.getIdToken().getJwtToken();\r\n const groups = getGroups(jwtToken);\r\n if (group && !groups.includes(group)) {\r\n return resolve(Action.loginFailure(user, 'Insufficient privilege'));\r\n }\r\n\r\n if (config.identityPool) {\r\n const username = user.getUsername();\r\n refreshIdentityCredentials(username, jwtToken, config).then(\r\n (creds) => {\r\n getUserAttributes(user).then((attributes) => {\r\n resolve(Action.login(creds, attributes, groups));\r\n });\r\n },\r\n message => resolve(Action.loginFailure(user, message)));\r\n } else {\r\n getUserAttributes(user).then((attributes) => {\r\n resolve(Action.login(null, attributes, groups));\r\n });\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n/**\r\n *\r\n * Authenticates with a user pool, and handles responses.\r\n * if the authentication is successful it then logs in to the\r\n * identity pool if provided in config.\r\n *\r\n * returns an action depending on the outcome. Possible actions returned\r\n * are:\r\n *\r\n * - login - valid user who is logged in\r\n * - loginFailure - failed to authenticate with user pool or identity pool\r\n * - mfaRequired - user now needs to enter MFA\r\n * - newPasswordRequired - user must change password on first login\r\n * - emailVerificationRequired - user must verify their email address\r\n * - emailVerificationFailed - email verification is required, but won't work\r\n *\r\n * Dispatch the resulting action, e.g.:\r\n *\r\n * ```\r\n * const { userPool, config } = state.cognito;\r\n * authenticate(username, password, userPool, config).then(dispatch);\r\n * ```\r\n *\r\n * @param {string} username - the username provided by the user\r\n * @param {string} password - the password provided by the user\r\n * @param {object} userPool - a Cognito User Pool object\r\n * @return {Promise} - a promise that resolves an action to be dispatched\r\n *\r\n*/\r\nconst authenticate = (username, password, userPool, config, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const creds = new AuthenticationDetails({\r\n Username: username,\r\n Password: password,\r\n });\r\n\r\n const user = new CognitoUser({\r\n Username: username,\r\n Pool: userPool,\r\n });\r\n\r\n user.authenticateUser(creds, {\r\n onSuccess: () => {\r\n dispatch(Action.authenticated(user));\r\n resolve();\r\n },\r\n onFailure: (error) => {\r\n if (error.code === 'UserNotConfirmedException') {\r\n dispatch(Action.confirmationRequired(user));\r\n resolve();\r\n } else {\r\n dispatch(Action.loginFailure(user, error.message));\r\n reject(error);\r\n }\r\n },\r\n mfaRequired: () => {\r\n dispatch(Action.mfaRequired(user));\r\n resolve();\r\n },\r\n newPasswordRequired: () => {\r\n dispatch(Action.newPasswordRequired(user));\r\n resolve();\r\n },\r\n });\r\n });\r\n\r\n/**\r\n * sign up this user with the user pool provided\r\n * @param {object} userPool - a Cognito userpool (e.g. state.cognito.userPool)\r\n * @param {object} config - the react-cognito config object\r\n * @param {string} username - the username\r\n * @param {string} password - the password\r\n * @param {object} attributes - an attributes dictionary\r\n * @return {Promise} a promise that resolves a redux action\r\n*/\r\nconst registerUser = (userPool, config, username, password, attributes) =>\r\n new Promise((resolve, reject) =>\r\n userPool.signUp(username, password, mkAttrList(attributes), null, (err, result) => {\r\n if (err) {\r\n reject(err.message);\r\n } else if (result.userConfirmed === false) {\r\n resolve(Action.confirmationRequired(result.user, attributes.email));\r\n } else {\r\n resolve(authenticate(username, password, userPool));\r\n }\r\n }));\r\n\r\n\r\nexport {\r\n authenticate,\r\n performLogin,\r\n registerUser,\r\n emailVerificationFlow,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/auth.js","\r\nimport { Action } from './actions';\r\n\r\n/**\r\n * Request that a verification code is sent by email or SMS to verify\r\n * an attribute\r\n * @param {object} user - the cognito user object\r\n * @param {string} attribute - the attribute name\r\n*/\r\nconst sendAttributeVerificationCode = (user, attribute) =>\r\n new Promise((resolve, reject) => {\r\n user.getAttributeVerificationCode(attribute, {\r\n onSuccess: () => resolve(false),\r\n inputVerificationCode: () => resolve(true),\r\n onFailure: error => reject(error.message),\r\n });\r\n });\r\n\r\n/**\r\n * Fetches the user attributes from Cognito, and turns them into\r\n * an object\r\n * @param {object} user - the cognito user object\r\n * @returns {Promise} resolves with the attributes or rejects with an error message\r\n*/\r\nconst getUserAttributes = user =>\r\n new Promise((resolve, reject) =>\r\n user.getUserAttributes((error, result) => {\r\n if (error) {\r\n reject(error.message);\r\n } else {\r\n const attributes = {};\r\n for (let i = 0; i < result.length; i += 1) {\r\n const name = result[i].getName();\r\n const value = result[i].getValue();\r\n attributes[name] = value;\r\n }\r\n resolve(attributes);\r\n }\r\n }),\r\n );\r\n\r\n/**\r\n * convert an attribute dictionary to an attribute list\r\n * @param {object} attributes - a dictionary of attributes\r\n * @return {array} AWS expected attribute list\r\n*/\r\nconst mkAttrList = attributes =>\r\n Object.keys(attributes).map(key => ({\r\n Name: key,\r\n Value: attributes[key],\r\n }));\r\n\r\n/**\r\n * update the attributes in Cognito\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} attributes - an attributes dictionary with the attributes to be updated\r\n * @return {Promise} a promise that resolves to a redux action\r\n*/\r\nconst updateAttributes = (user, attributes) =>\r\n new Promise((resolve, reject) => {\r\n const attributeList = mkAttrList(attributes);\r\n user.updateAttributes(attributeList, (err) => {\r\n if (err) {\r\n reject(err.message);\r\n } else {\r\n resolve(Action.updateAttributes(attributes));\r\n }\r\n });\r\n });\r\n\r\nexport {\r\n sendAttributeVerificationCode,\r\n getUserAttributes,\r\n updateAttributes,\r\n mkAttrList,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/attributes.js","import { Action } from './actions';\r\nimport { getUserAttributes } from './attributes';\r\nimport { emailVerificationFlow, performLogin } from './auth';\r\nimport { CognitoState } from './states';\r\n\r\n/**\r\n * subscribes a \"policy\" function to the store, and calls it\r\n * with the state and the dispatch function\r\n * @param {object} store - the redux store\r\n * @param {function} f - f(state, dispatch)\r\n*/\r\nconst enable = (store, f, params) => {\r\n store.subscribe(() => {\r\n const state = store.getState();\r\n const dispatch = store.dispatch;\r\n f(state, dispatch, params);\r\n });\r\n};\r\n\r\n/**\r\n * requires email verification before transitioning from AUTHENTICATED\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst emailVerificationRequired = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n const user = state.cognito.user;\r\n getUserAttributes(user).then((attributes) => {\r\n if (attributes.email_verified !== 'true') {\r\n emailVerificationFlow(user, attributes).then(dispatch);\r\n } else {\r\n dispatch(Action.loggingIn(attributes));\r\n }\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * fetches and stores attributes before transitioning from AUTHENTICATED\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst fetchAttributes = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n const user = state.cognito.user;\r\n getUserAttributes(user).then((attributes) => {\r\n dispatch(Action.loggingIn(attributes));\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * transitions directly from AUTHENTICATED to LOGGING_IN\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst direct = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n dispatch(Action.loggingIn());\r\n }\r\n};\r\n\r\n/**\r\n * logs into the single federated identity pool to transition from LOGGING_IN\r\n * to LOGGED_IN\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst identityPoolLogin = (state, dispatch, group) => {\r\n if (state.cognito.state === CognitoState.LOGGING_IN) {\r\n performLogin(state.cognito.user, state.cognito.config, group).then(dispatch);\r\n }\r\n};\r\n\r\n/**\r\n * sets up react-cognito with default policies.\r\n*/\r\nconst setupCognito = (store, config, listeners =\r\n [emailVerificationRequired, identityPoolLogin]) => {\r\n store.dispatch(Action.configure(config));\r\n listeners.forEach((f) => {\r\n enable(store, f, config.group);\r\n });\r\n store.dispatch(Action.loggingIn({}));\r\n};\r\n\r\nexport {\r\n setupCognito,\r\n enable,\r\n direct,\r\n fetchAttributes,\r\n emailVerificationRequired,\r\n identityPoolLogin,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/policy.js","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { authenticate } from './auth';\r\nimport { Action } from './actions';\r\n\r\nconst BaseLogin = props =>\r\n React.cloneElement(props.children, {\r\n username: props.username,\r\n email: props.email,\r\n onSubmit: props.onSubmit,\r\n clearCache: props.clearCache,\r\n error: props.error,\r\n });\r\n\r\nconst mapStateToProps = (state) => {\r\n let username = '';\r\n if (state.cognito.user) {\r\n username = state.cognito.user.getUsername();\r\n } else if (state.cognito.userName) {\r\n username = state.cognito.cache.userName;\r\n }\r\n return {\r\n username,\r\n email: state.cognito.cache.email,\r\n config: state.cognito.config,\r\n userPool: state.cognito.userPool,\r\n error: state.cognito.error,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n authenticator: (username, password, userPool, config) =>\r\n authenticate(username, password, userPool, config, dispatch),\r\n clearCache: () => dispatch(Action.clearCache()),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n onSubmit: (username, password) =>\r\n dispatchProps.authenticator(username, password, stateProps.userPool, stateProps.config),\r\n clearCache: dispatchProps.clearCache,\r\n });\r\n\r\n/**\r\n * Container for login behaviour, wrapping a login form.\r\n *\r\n * Magically provides the following props to the wrapped form:\r\n *\r\n * * username\r\n * * onSubmit\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nconst Login = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseLogin);\r\n\r\nexport { Login };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Login.jsx","module.exports = __WEBPACK_EXTERNAL_MODULE_12__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n// module id = 12\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_13__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"ReactRedux\",\"commonjs\":\"react-redux\",\"commonjs2\":\"react-redux\",\"amd\":\"react-redux\"}\n// module id = 13\n// module chunks = 0","import React from 'react';\r\nimport PropTypes from 'prop-types'\r\nimport { Action } from './actions';\r\n\r\n/**\r\n * Container for logout behaviour.\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nexport class Logout extends React.Component {\r\n\r\n /**\r\n * Passed to child element as onClick prop.\r\n * Signs the user out, and then dispatches the logout action\r\n * If you want to take further actions (like reloading UI) then add an\r\n * onLogout property to the Logout element\r\n */\r\n onClick = (event) => {\r\n const { store } = this.context;\r\n const state = store.getState();\r\n state.cognito.user.signOut();\r\n event.preventDefault();\r\n store.dispatch(Action.logout());\r\n this.props.onLogout();\r\n }\r\n\r\n /**\r\n * renders the child element, adding an onClick property\r\n */\r\n render() {\r\n return React.cloneElement(this.props.children, {\r\n onClick: this.onClick,\r\n });\r\n }\r\n}\r\nLogout.contextTypes = {\r\n store: PropTypes.object,\r\n};\r\nLogout.propTypes = {\r\n children: PropTypes.any.isRequired,\r\n onLogout: PropTypes.func,\r\n};\r\nLogout.defaultProps = {\r\n onLogout: () => {},\r\n};\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Logout.jsx","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 15\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar warning = require('fbjs/lib/warning');\nvar assign = require('object-assign');\n\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\nvar checkPropTypes = require('./checkPropTypes');\n\nmodule.exports = function(isValidElement, throwOnDirectAccess) {\n /* global Symbol */\n var ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n var FAUX_ITERATOR_SYMBOL = '@@iterator'; // Before Symbol spec.\n\n /**\n * Returns the iterator method function contained on the iterable object.\n *\n * Be sure to invoke the function with the iterable as context:\n *\n * var iteratorFn = getIteratorFn(myIterable);\n * if (iteratorFn) {\n * var iterator = iteratorFn.call(myIterable);\n * ...\n * }\n *\n * @param {?object} maybeIterable\n * @return {?function}\n */\n function getIteratorFn(maybeIterable) {\n var iteratorFn = maybeIterable && (ITERATOR_SYMBOL && maybeIterable[ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL]);\n if (typeof iteratorFn === 'function') {\n return iteratorFn;\n }\n }\n\n /**\n * Collection of methods that allow declaration and validation of props that are\n * supplied to React components. Example usage:\n *\n * var Props = require('ReactPropTypes');\n * var MyArticle = React.createClass({\n * propTypes: {\n * // An optional string prop named \"description\".\n * description: Props.string,\n *\n * // A required enum prop named \"category\".\n * category: Props.oneOf(['News','Photos']).isRequired,\n *\n * // A prop named \"dialog\" that requires an instance of Dialog.\n * dialog: Props.instanceOf(Dialog).isRequired\n * },\n * render: function() { ... }\n * });\n *\n * A more formal specification of how these methods are used:\n *\n * type := array|bool|func|object|number|string|oneOf([...])|instanceOf(...)\n * decl := ReactPropTypes.{type}(.isRequired)?\n *\n * Each and every declaration produces a function with the same signature. This\n * allows the creation of custom validation functions. For example:\n *\n * var MyLink = React.createClass({\n * propTypes: {\n * // An optional string or URI prop named \"href\".\n * href: function(props, propName, componentName) {\n * var propValue = props[propName];\n * if (propValue != null && typeof propValue !== 'string' &&\n * !(propValue instanceof URI)) {\n * return new Error(\n * 'Expected a string or an URI for ' + propName + ' in ' +\n * componentName\n * );\n * }\n * }\n * },\n * render: function() {...}\n * });\n *\n * @internal\n */\n\n var ANONYMOUS = '<>';\n\n // Important!\n // Keep this list in sync with production version in `./factoryWithThrowingShims.js`.\n var ReactPropTypes = {\n array: createPrimitiveTypeChecker('array'),\n bool: createPrimitiveTypeChecker('boolean'),\n func: createPrimitiveTypeChecker('function'),\n number: createPrimitiveTypeChecker('number'),\n object: createPrimitiveTypeChecker('object'),\n string: createPrimitiveTypeChecker('string'),\n symbol: createPrimitiveTypeChecker('symbol'),\n\n any: createAnyTypeChecker(),\n arrayOf: createArrayOfTypeChecker,\n element: createElementTypeChecker(),\n instanceOf: createInstanceTypeChecker,\n node: createNodeChecker(),\n objectOf: createObjectOfTypeChecker,\n oneOf: createEnumTypeChecker,\n oneOfType: createUnionTypeChecker,\n shape: createShapeTypeChecker,\n exact: createStrictShapeTypeChecker,\n };\n\n /**\n * inlined Object.is polyfill to avoid requiring consumers ship their own\n * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is\n */\n /*eslint-disable no-self-compare*/\n function is(x, y) {\n // SameValue algorithm\n if (x === y) {\n // Steps 1-5, 7-10\n // Steps 6.b-6.e: +0 != -0\n return x !== 0 || 1 / x === 1 / y;\n } else {\n // Step 6.a: NaN == NaN\n return x !== x && y !== y;\n }\n }\n /*eslint-enable no-self-compare*/\n\n /**\n * We use an Error-like object for backward compatibility as people may call\n * PropTypes directly and inspect their output. However, we don't use real\n * Errors anymore. We don't inspect their stack anyway, and creating them\n * is prohibitively expensive if they are created too often, such as what\n * happens in oneOfType() for any type before the one that matched.\n */\n function PropTypeError(message) {\n this.message = message;\n this.stack = '';\n }\n // Make `instanceof Error` still work for returned errors.\n PropTypeError.prototype = Error.prototype;\n\n function createChainableTypeChecker(validate) {\n if (process.env.NODE_ENV !== 'production') {\n var manualPropTypeCallCache = {};\n var manualPropTypeWarningCount = 0;\n }\n function checkType(isRequired, props, propName, componentName, location, propFullName, secret) {\n componentName = componentName || ANONYMOUS;\n propFullName = propFullName || propName;\n\n if (secret !== ReactPropTypesSecret) {\n if (throwOnDirectAccess) {\n // New behavior only for users of `prop-types` package\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use `PropTypes.checkPropTypes()` to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n } else if (process.env.NODE_ENV !== 'production' && typeof console !== 'undefined') {\n // Old behavior for people using React.PropTypes\n var cacheKey = componentName + ':' + propName;\n if (\n !manualPropTypeCallCache[cacheKey] &&\n // Avoid spamming the console because they are often not actionable except for lib authors\n manualPropTypeWarningCount < 3\n ) {\n warning(\n false,\n 'You are manually calling a React.PropTypes validation ' +\n 'function for the `%s` prop on `%s`. This is deprecated ' +\n 'and will throw in the standalone `prop-types` package. ' +\n 'You may be seeing this warning due to a third-party PropTypes ' +\n 'library. See https://fb.me/react-warning-dont-call-proptypes ' + 'for details.',\n propFullName,\n componentName\n );\n manualPropTypeCallCache[cacheKey] = true;\n manualPropTypeWarningCount++;\n }\n }\n }\n if (props[propName] == null) {\n if (isRequired) {\n if (props[propName] === null) {\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required ' + ('in `' + componentName + '`, but its value is `null`.'));\n }\n return new PropTypeError('The ' + location + ' `' + propFullName + '` is marked as required in ' + ('`' + componentName + '`, but its value is `undefined`.'));\n }\n return null;\n } else {\n return validate(props, propName, componentName, location, propFullName);\n }\n }\n\n var chainedCheckType = checkType.bind(null, false);\n chainedCheckType.isRequired = checkType.bind(null, true);\n\n return chainedCheckType;\n }\n\n function createPrimitiveTypeChecker(expectedType) {\n function validate(props, propName, componentName, location, propFullName, secret) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== expectedType) {\n // `propValue` being instance of, say, date/regexp, pass the 'object'\n // check, but we can offer a more precise error message here rather than\n // 'of type `object`'.\n var preciseType = getPreciseType(propValue);\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + preciseType + '` supplied to `' + componentName + '`, expected ') + ('`' + expectedType + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createAnyTypeChecker() {\n return createChainableTypeChecker(emptyFunction.thatReturnsNull);\n }\n\n function createArrayOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside arrayOf.');\n }\n var propValue = props[propName];\n if (!Array.isArray(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an array.'));\n }\n for (var i = 0; i < propValue.length; i++) {\n var error = typeChecker(propValue, i, componentName, location, propFullName + '[' + i + ']', ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createElementTypeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n if (!isValidElement(propValue)) {\n var propType = getPropType(propValue);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected a single ReactElement.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createInstanceTypeChecker(expectedClass) {\n function validate(props, propName, componentName, location, propFullName) {\n if (!(props[propName] instanceof expectedClass)) {\n var expectedClassName = expectedClass.name || ANONYMOUS;\n var actualClassName = getClassName(props[propName]);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + actualClassName + '` supplied to `' + componentName + '`, expected ') + ('instance of `' + expectedClassName + '`.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createEnumTypeChecker(expectedValues) {\n if (!Array.isArray(expectedValues)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOf, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n for (var i = 0; i < expectedValues.length; i++) {\n if (is(propValue, expectedValues[i])) {\n return null;\n }\n }\n\n var valuesString = JSON.stringify(expectedValues);\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of value `' + propValue + '` ' + ('supplied to `' + componentName + '`, expected one of ' + valuesString + '.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createObjectOfTypeChecker(typeChecker) {\n function validate(props, propName, componentName, location, propFullName) {\n if (typeof typeChecker !== 'function') {\n return new PropTypeError('Property `' + propFullName + '` of component `' + componentName + '` has invalid PropType notation inside objectOf.');\n }\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type ' + ('`' + propType + '` supplied to `' + componentName + '`, expected an object.'));\n }\n for (var key in propValue) {\n if (propValue.hasOwnProperty(key)) {\n var error = typeChecker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error instanceof Error) {\n return error;\n }\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createUnionTypeChecker(arrayOfTypeCheckers) {\n if (!Array.isArray(arrayOfTypeCheckers)) {\n process.env.NODE_ENV !== 'production' ? warning(false, 'Invalid argument supplied to oneOfType, expected an instance of array.') : void 0;\n return emptyFunction.thatReturnsNull;\n }\n\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (typeof checker !== 'function') {\n warning(\n false,\n 'Invalid argument supplied to oneOfType. Expected an array of check functions, but ' +\n 'received %s at index %s.',\n getPostfixForTypeWarning(checker),\n i\n );\n return emptyFunction.thatReturnsNull;\n }\n }\n\n function validate(props, propName, componentName, location, propFullName) {\n for (var i = 0; i < arrayOfTypeCheckers.length; i++) {\n var checker = arrayOfTypeCheckers[i];\n if (checker(props, propName, componentName, location, propFullName, ReactPropTypesSecret) == null) {\n return null;\n }\n }\n\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`.'));\n }\n return createChainableTypeChecker(validate);\n }\n\n function createNodeChecker() {\n function validate(props, propName, componentName, location, propFullName) {\n if (!isNode(props[propName])) {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` supplied to ' + ('`' + componentName + '`, expected a ReactNode.'));\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n for (var key in shapeTypes) {\n var checker = shapeTypes[key];\n if (!checker) {\n continue;\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n return createChainableTypeChecker(validate);\n }\n\n function createStrictShapeTypeChecker(shapeTypes) {\n function validate(props, propName, componentName, location, propFullName) {\n var propValue = props[propName];\n var propType = getPropType(propValue);\n if (propType !== 'object') {\n return new PropTypeError('Invalid ' + location + ' `' + propFullName + '` of type `' + propType + '` ' + ('supplied to `' + componentName + '`, expected `object`.'));\n }\n // We need to check all keys in case some are required but missing from\n // props.\n var allKeys = assign({}, props[propName], shapeTypes);\n for (var key in allKeys) {\n var checker = shapeTypes[key];\n if (!checker) {\n return new PropTypeError(\n 'Invalid ' + location + ' `' + propFullName + '` key `' + key + '` supplied to `' + componentName + '`.' +\n '\\nBad object: ' + JSON.stringify(props[propName], null, ' ') +\n '\\nValid keys: ' + JSON.stringify(Object.keys(shapeTypes), null, ' ')\n );\n }\n var error = checker(propValue, key, componentName, location, propFullName + '.' + key, ReactPropTypesSecret);\n if (error) {\n return error;\n }\n }\n return null;\n }\n\n return createChainableTypeChecker(validate);\n }\n\n function isNode(propValue) {\n switch (typeof propValue) {\n case 'number':\n case 'string':\n case 'undefined':\n return true;\n case 'boolean':\n return !propValue;\n case 'object':\n if (Array.isArray(propValue)) {\n return propValue.every(isNode);\n }\n if (propValue === null || isValidElement(propValue)) {\n return true;\n }\n\n var iteratorFn = getIteratorFn(propValue);\n if (iteratorFn) {\n var iterator = iteratorFn.call(propValue);\n var step;\n if (iteratorFn !== propValue.entries) {\n while (!(step = iterator.next()).done) {\n if (!isNode(step.value)) {\n return false;\n }\n }\n } else {\n // Iterator will provide entry [k,v] tuples rather than values.\n while (!(step = iterator.next()).done) {\n var entry = step.value;\n if (entry) {\n if (!isNode(entry[1])) {\n return false;\n }\n }\n }\n }\n } else {\n return false;\n }\n\n return true;\n default:\n return false;\n }\n }\n\n function isSymbol(propType, propValue) {\n // Native Symbol.\n if (propType === 'symbol') {\n return true;\n }\n\n // 19.4.3.5 Symbol.prototype[@@toStringTag] === 'Symbol'\n if (propValue['@@toStringTag'] === 'Symbol') {\n return true;\n }\n\n // Fallback for non-spec compliant Symbols which are polyfilled.\n if (typeof Symbol === 'function' && propValue instanceof Symbol) {\n return true;\n }\n\n return false;\n }\n\n // Equivalent of `typeof` but with special handling for array and regexp.\n function getPropType(propValue) {\n var propType = typeof propValue;\n if (Array.isArray(propValue)) {\n return 'array';\n }\n if (propValue instanceof RegExp) {\n // Old webkits (at least until Android 4.0) return 'function' rather than\n // 'object' for typeof a RegExp. We'll normalize this here so that /bla/\n // passes PropTypes.object.\n return 'object';\n }\n if (isSymbol(propType, propValue)) {\n return 'symbol';\n }\n return propType;\n }\n\n // This handles more types than `getPropType`. Only used for error messages.\n // See `createPrimitiveTypeChecker`.\n function getPreciseType(propValue) {\n if (typeof propValue === 'undefined' || propValue === null) {\n return '' + propValue;\n }\n var propType = getPropType(propValue);\n if (propType === 'object') {\n if (propValue instanceof Date) {\n return 'date';\n } else if (propValue instanceof RegExp) {\n return 'regexp';\n }\n }\n return propType;\n }\n\n // Returns a string that is postfixed to a warning about an invalid type.\n // For example, \"undefined\" or \"of type array\"\n function getPostfixForTypeWarning(value) {\n var type = getPreciseType(value);\n switch (type) {\n case 'array':\n case 'object':\n return 'an ' + type;\n case 'boolean':\n case 'date':\n case 'regexp':\n return 'a ' + type;\n default:\n return type;\n }\n }\n\n // Returns class name of the object, if any.\n function getClassName(propValue) {\n if (!propValue.constructor || !propValue.constructor.name) {\n return ANONYMOUS;\n }\n return propValue.constructor.name;\n }\n\n ReactPropTypes.checkPropTypes = checkPropTypes;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithTypeCheckers.js\n// module id = 16\n// module chunks = 0","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 17\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 18\n// module chunks = 0","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\nvar emptyFunction = require('./emptyFunction');\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar warning = emptyFunction;\n\nif (process.env.NODE_ENV !== 'production') {\n var printWarning = function printWarning(format) {\n for (var _len = arguments.length, args = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n var argIndex = 0;\n var message = 'Warning: ' + format.replace(/%s/g, function () {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n };\n\n warning = function warning(condition, format) {\n if (format === undefined) {\n throw new Error('`warning(condition, format, ...args)` requires a warning ' + 'message argument');\n }\n\n if (format.indexOf('Failed Composite propType: ') === 0) {\n return; // Ignore CompositeComponent proptype check.\n }\n\n if (!condition) {\n for (var _len2 = arguments.length, args = Array(_len2 > 2 ? _len2 - 2 : 0), _key2 = 2; _key2 < _len2; _key2++) {\n args[_key2 - 2] = arguments[_key2];\n }\n\n printWarning.apply(undefined, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/warning.js\n// module id = 19\n// module chunks = 0","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/object-assign/index.js\n// module id = 20\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 21\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nif (process.env.NODE_ENV !== 'production') {\n var invariant = require('fbjs/lib/invariant');\n var warning = require('fbjs/lib/warning');\n var ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n var loggedTypeFailures = {};\n}\n\n/**\n * Assert that the values match with the type specs.\n * Error messages are memorized and will only be shown once.\n *\n * @param {object} typeSpecs Map of name to a ReactPropType\n * @param {object} values Runtime values that need to be type-checked\n * @param {string} location e.g. \"prop\", \"context\", \"child context\"\n * @param {string} componentName Name of the component for error messages.\n * @param {?Function} getStack Returns the component stack.\n * @private\n */\nfunction checkPropTypes(typeSpecs, values, location, componentName, getStack) {\n if (process.env.NODE_ENV !== 'production') {\n for (var typeSpecName in typeSpecs) {\n if (typeSpecs.hasOwnProperty(typeSpecName)) {\n var error;\n // Prop type validation may throw. In case they do, we don't want to\n // fail the render phase where it didn't fail before. So we log it.\n // After these have been cleaned up, we'll let them throw.\n try {\n // This is intentionally an invariant that gets caught. It's the same\n // behavior as without this statement except with a better message.\n invariant(typeof typeSpecs[typeSpecName] === 'function', '%s: %s type `%s` is invalid; it must be a function, usually from ' + 'the `prop-types` package, but received `%s`.', componentName || 'React class', location, typeSpecName, typeof typeSpecs[typeSpecName]);\n error = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, ReactPropTypesSecret);\n } catch (ex) {\n error = ex;\n }\n warning(!error || error instanceof Error, '%s: type specification of %s `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error);\n if (error instanceof Error && !(error.message in loggedTypeFailures)) {\n // Only monitor this failure once because there tends to be a lot of the\n // same error.\n loggedTypeFailures[error.message] = true;\n\n var stack = getStack ? getStack() : '';\n\n warning(false, 'Failed %s type: %s%s', location, error.message, stack != null ? stack : '');\n }\n }\n }\n }\n}\n\nmodule.exports = checkPropTypes;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/checkPropTypes.js\n// module id = 22\n// module chunks = 0","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseNewPasswordRequired = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n });\r\n\r\nconst setNewPassword = (password, user, config, userAttributes, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.completeNewPasswordChallenge(password, userAttributes, {\r\n onSuccess: () => {\r\n dispatch(Action.authenticated(user));\r\n resolve();\r\n },\r\n onFailure: error => {\r\n dispatch(Action.newPasswordRequiredFailure(user, error.message));\r\n reject(error);\r\n },\r\n mfaRequired: () => {\r\n dispatch(Action.mfaRequired(user));\r\n resolve();\r\n },\r\n newPasswordRequired: () => {\r\n dispatch(Action.newPasswordRequired(user));\r\n resolve();\r\n },\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n config: state.cognito.config,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n setNewPasswordPartial: (password, user, config, userAttributes) =>\r\n setNewPassword(password, user, config, userAttributes, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n onSubmit: (password, userAttributes) =>\r\n dispatchProps.setNewPasswordPartial(\r\n password,\r\n stateProps.user,\r\n stateProps.config,\r\n userAttributes),\r\n });\r\n\r\n/**\r\n * Wrapper for a New Password Required form\r\n *\r\n * Magically provides the following props to the wrapped element:\r\n *\r\n * * user - the Cognito user\r\n * * error - the persistent react-cognito error message\r\n * * onSubmit - a handler that calls the Set New Password API\r\n *\r\n * @example\r\n *\r\n * \r\n * \r\n * \r\n */\r\nexport const NewPasswordRequired = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseNewPasswordRequired);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/NewPasswordRequired.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseEmailVerification = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n onCancel: props.onCancel,\r\n });\r\n\r\nexport const verifyEmail = (verificationCode, user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.verifyAttribute('email', verificationCode, {\r\n onSuccess: () => {\r\n dispatch(Action.login(user));\r\n resolve();\r\n },\r\n inputVerificationCode: () => {\r\n dispatch(Action.emailVerificationRequired(user));\r\n reject();\r\n },\r\n onFailure: (error) => {\r\n dispatch(Action.emailVerificationFailed(user, error.message));\r\n reject();\r\n },\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n verifyPartial: (verificationCode, user) =>\r\n verifyEmail(verificationCode, user, dispatch),\r\n onCancel: () => dispatch(Action.logout()),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, dispatchProps, {\r\n onSubmit: verificationCode =>\r\n dispatchProps.verifyPartial(verificationCode, stateProps.user),\r\n });\r\n\r\n/**\r\n * Wrapper for an Email Verification Form.\r\n * Magically adds the following props to the contained form:\r\n *\r\n * * user - the Cognito user from the Redux store\r\n * * error - the persisted error from the Redux store\r\n * * onSubmit - a handler that calls the Cognito verification API\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n *\r\n */\r\nexport const EmailVerification = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseEmailVerification);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/EmailVerification.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { CognitoUser } from 'amazon-cognito-identity-js';\r\nimport { Action } from './actions';\r\n\r\nconst BasePasswordReset = props =>\r\n React.cloneElement(props.children, {\r\n username: props.username,\r\n sendVerificationCode: props.sendVerificationCode,\r\n setPassword: props.setPassword,\r\n });\r\n\r\nconst getUser = (username, userPool) => {\r\n const user = new CognitoUser({\r\n Username: username,\r\n Pool: userPool,\r\n });\r\n return user;\r\n};\r\n\r\nconst setPassword = (username, userPool, code, password, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const user = getUser(username, userPool);\r\n user.confirmPassword(code, password, {\r\n onSuccess: () => {\r\n dispatch(Action.finishPasswordResetFlow()),\r\n resolve();\r\n },\r\n onFailure: err => {\r\n dispatch(Action.beginPasswordResetFlow(user, err.message)),\r\n reject(err);\r\n }\r\n });\r\n });\r\n\r\n\r\nconst sendVerificationCode = (username, userPool, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const user = getUser(username, userPool);\r\n user.forgotPassword({\r\n onSuccess: () => {\r\n dispatch(Action.continuePasswordResetFlow(user));\r\n resolve();\r\n },\r\n onFailure: err => {\r\n dispatch(Action.beginPasswordResetFlow(user, err.message));\r\n reject(err);\r\n }\r\n });\r\n });\r\n\r\n\r\nconst mapStateToProps = (state) => {\r\n const props = {\r\n user: state.cognito.user,\r\n username: '',\r\n userPool: state.cognito.userPool,\r\n };\r\n if (state.cognito.user != null) {\r\n props.username = state.cognito.user.getUsername();\r\n }\r\n return props;\r\n};\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n sendVerificationCodePartial: (username, userPool) =>\r\n sendVerificationCode(username, userPool, dispatch),\r\n setPasswordPartial: (user, userPool, code, password) =>\r\n setPassword(user, userPool, code, password, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n sendVerificationCode: username =>\r\n dispatchProps.sendVerificationCodePartial(username, stateProps.userPool),\r\n setPassword: (username, code, password) =>\r\n dispatchProps.setPasswordPartial(username, stateProps.userPool, code, password),\r\n });\r\n\r\n/**\r\n * Container for a Password Reset form\r\n *\r\n * Magically provides the following props to the wrapped element:\r\n *\r\n * * user\r\n * * username\r\n * * sendVerificationCode\r\n * * setPassword\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nexport const PasswordReset = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BasePasswordReset);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/PasswordReset.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseConfirm = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n onResend: props.onResend,\r\n onCancel: props.onCancel,\r\n });\r\n\r\nconst confirm = (verificationCode, user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.confirmRegistration(verificationCode, true, (error) => {\r\n if (error) {\r\n dispatch(Action.confirmFailed(user));\r\n reject(error.message);\r\n } else {\r\n dispatch(Action.partialLogout());\r\n resolve(user);\r\n }\r\n });\r\n });\r\n\r\nconst resend = (user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.resendConfirmationCode((err) => {\r\n if (err) {\r\n dispatch(Action.confirmationRequired(user));\r\n reject(err.message);\r\n } else {\r\n dispatch(Action.confirmationRequired(user));\r\n resolve(user);\r\n }\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n confirmPartial: (verificationCode, user) =>\r\n confirm(verificationCode, user, dispatch),\r\n onCancel: () => dispatch(Action.logout()),\r\n onResendPartial: user => resend(user, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, dispatchProps, {\r\n onSubmit: verificationCode =>\r\n dispatchProps.confirmPartial(verificationCode, stateProps.user),\r\n onResend: () =>\r\n dispatchProps.onResendPartial(stateProps.user),\r\n });\r\n\r\n/**\r\n * Container for a confirmation form. Magically adds the following props to the \r\n * contained form:\r\n *\r\n * * user - the Cognito User from the redux store\r\n * * error - the persisted error from the redux store\r\n * * onSubmit - a handler that calls the Cognito confirm API\r\n * * onResend - a handler that calls the Cognito resend request API\r\n * * onCancel - Logs the user out completely\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n *\r\n */\r\nexport const Confirm = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseConfirm);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Confirm.jsx"],"sourceRoot":""} \ No newline at end of file diff --git a/dist/react-cognito.min.js b/dist/react-cognito.min.js new file mode 100644 index 0000000..d011a1c --- /dev/null +++ b/dist/react-cognito.min.js @@ -0,0 +1,2 @@ +!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("react"),require("react-redux"),require("amazon-cognito-identity-js"),require("aws-sdk/global")):"function"==typeof define&&define.amd?define(["react","react-redux","amazon-cognito-identity-js","aws-sdk/global"],t):"object"==typeof exports?exports.ReactCognito=t(require("react"),require("react-redux"),require("amazon-cognito-identity-js"),require("aws-sdk/global")):e.ReactCognito=t(e.React,e.ReactRedux,e.AmazonCognitoIdentity,e["aws-sdk/global"])}(this,function(e,t,n,r){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(18);Object.keys(r).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return r[e]}})});var o=n(1);Object.keys(o).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return o[e]}})});var i=n(6);Object.keys(i).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return i[e]}})});var u=n(8);Object.keys(u).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return u[e]}})});var c=n(16);Object.keys(c).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return c[e]}})});var s=n(5);Object.keys(s).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return s[e]}})});var a=n(4);Object.keys(a).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return a[e]}})});var f=n(17);Object.keys(f).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return f[e]}})});var l=n(12);Object.keys(l).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return l[e]}})});var d=n(13);Object.keys(d).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return d[e]}})});var g=n(14);Object.keys(g).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return g[e]}})});var O=n(11);Object.keys(O).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return O[e]}})});var _=n(15);Object.keys(_).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return _[e]}})});var I=n(10);Object.keys(I).forEach(function(e){"default"!==e&&"__esModule"!==e&&Object.defineProperty(t,e,{enumerable:!0,get:function(){return I[e]}})})},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n={configure:function(e){return{type:"COGNITO_CONFIGURE",config:e}},authenticated:function(e){return{type:"COGNITO_AUTHENTICATED",user:e}},loggingIn:function(e){return{type:"COGNITO_LOGGING_IN",attributes:e}},login:function(e,t,n){return{type:"COGNITO_LOGIN",creds:e,groups:n,attributes:t}},logout:function(){return{type:"COGNITO_LOGOUT"}},partialLogout:function(){return{type:"COGNITO_PARTIAL_LOGOUT"}},loginFailure:function(e,t){return{type:"COGNITO_LOGIN_FAILURE",user:e,error:t}},mfaRequired:function(e){return{type:"COGNITO_LOGIN_MFA_REQUIRED",user:e}},newPasswordRequired:function(e){return{type:"COGNITO_LOGIN_NEW_PASSWORD_REQUIRED",user:e}},newPasswordRequiredFailure:function(e,t){return{type:"COGNITO_NEW_PASSWORD_REQUIRED_FAILURE",user:e,error:t}},emailVerificationRequired:function(e){return{type:"COGNITO_EMAIL_VERIFICATION_REQUIRED",attributes:e}},emailVerificationFailed:function(e,t){return{type:"COGNITO_EMAIL_VERIFICATION_FAILED",user:e,error:t}},beginPasswordResetFlow:function(e,t){return{type:"COGNITO_BEGIN_PASSWORD_RESET_FLOW",user:e,error:t}},continuePasswordResetFlow:function(e){return{type:"COGNITO_CONTINUE_PASSWORD_RESET_FLOW",user:e}},finishPasswordResetFlow:function(e){return{type:"COGNITO_FINISH_PASSWORD_RESET_FLOW",error:e}},updateAttributes:function(e){return{type:"COGNITO_UPDATE_USER_ATTRIBUTES",attributes:e}},confirmationRequired:function(e,t){return{type:"COGNITO_USER_UNCONFIRMED",user:e,email:t}},confirmFailed:function(e,t){return{type:"COGNITO_USER_CONFIRM_FAILED",user:e,error:t}},clearCache:function(){return{type:"COGNITO_CLEAR_CACHE"}}};t.Action=n},function(t,n){t.exports=e},function(e,n){e.exports=t},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.mkAttrList=t.updateAttributes=t.getUserAttributes=t.sendAttributeVerificationCode=void 0;var r=n(1),o=function(e,t){return new Promise(function(n,r){e.getAttributeVerificationCode(t,{onSuccess:function(){return n(!1)},inputVerificationCode:function(){return n(!0)},onFailure:function(e){return r(e.message)}})})},i=function(e){return new Promise(function(t,n){return e.getUserAttributes(function(e,r){if(e)n(e.message);else{for(var o={},i=0;i2&&void 0!==arguments[2]?arguments[2]:{},o=(arguments[3],arguments[4]),i=arguments[5],u=e.getState(),c=t;void 0!==n.forbiddenUrl&&(c=n.forbiddenUrl),r(u,n).then(function(e){e||o(c),i()})},i=function(e,t){return function(n){return function(r,i,u){return o(e,t,n,r,i,u)}}};t.createGuard=i},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.identityPoolLogin=t.emailVerificationRequired=t.fetchAttributes=t.direct=t.enable=t.setupCognito=void 0;var r=n(1),o=n(4),i=n(5),u=n(6),c=function(e,t,n){e.subscribe(function(){var r=e.getState(),o=e.dispatch;t(r,o,n)})},s=function(e,t){if(e.cognito.state===u.CognitoState.AUTHENTICATED){var n=e.cognito.user;(0,o.getUserAttributes)(n).then(function(e){"true"!==e.email_verified?(0,i.emailVerificationFlow)(n,e).then(t):t(r.Action.loggingIn(e))})}},a=function(e,t){if(e.cognito.state===u.CognitoState.AUTHENTICATED){var n=e.cognito.user;(0,o.getUserAttributes)(n).then(function(e){t(r.Action.loggingIn(e))})}},f=function(e,t){e.cognito.state===u.CognitoState.AUTHENTICATED&&t(r.Action.loggingIn())},l=function(e,t,n){e.cognito.state===u.CognitoState.LOGGING_IN&&(0,i.performLogin)(e.cognito.user,e.cognito.config,n).then(t)},d=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[s,l];e.dispatch(r.Action.configure(t)),n.forEach(function(n){c(e,n,t.group)}),e.dispatch(r.Action.loggingIn({}))};t.setupCognito=d,t.enable=c,t.direct=f,t.fetchAttributes=a,t.emailVerificationRequired=s,t.identityPoolLogin=l},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.cognito=void 0;var r=n(7),o=n(6),i={user:null,cache:{userName:null,email:null},state:o.CognitoState.LOGGED_OUT,error:"",userPool:null,attributes:{},creds:null,groups:[],config:{region:null,userPool:null,clientId:null,identityPool:null}},u=function(e,t){AWS.config.region=t.config.region;var n=new r.CognitoUserPool({UserPoolId:t.config.userPool,ClientId:t.config.clientId}),o=n.getCurrentUser();return Object.assign({},e,{config:t.config,userPool:n,user:o})},c=function(e,t){var n=Object.assign({},e);return t&&(n.attributes=t),n};t.cognito=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:i,t=arguments[1];switch(t.type){case"COGNITO_CONFIGURE":return u(e,t);case"COGNITO_AUTHENTICATED":return Object.assign({},e,{user:t.user,cache:{userName:null,email:null},error:"",state:o.CognitoState.AUTHENTICATED});case"COGNITO_CLEAR_CACHE":return Object.assign({},e,{cache:{userName:null,email:null}});case"COGNITO_LOGGING_IN":return Object.assign({},e,{state:o.CognitoState.LOGGING_IN,attributes:t.attributes});case"COGNITO_LOGIN":return Object.assign({},e,c({error:"",creds:t.creds,groups:t.groups,state:o.CognitoState.LOGGED_IN},t.attributes));case"COGNITO_LOGOUT":return Object.assign({},e,{user:null,attributes:{},error:"",creds:null,groups:[],state:o.CognitoState.LOGGED_OUT});case"COGNITO_PARTIAL_LOGOUT":return Object.assign({},e,{user:null,userName:e.user.username,error:"",creds:null,groups:[],state:o.CognitoState.LOGGED_OUT});case"COGNITO_LOGIN_FAILURE":return Object.assign({},e,{user:t.user,state:o.CognitoState.LOGGED_OUT,error:t.error});case"COGNITO_LOGIN_MFA_REQUIRED":return Object.assign({},e,{user:t.user,error:"",state:o.CognitoState.MFA_REQUIRED});case"COGNITO_LOGIN_NEW_PASSWORD_REQUIRED":return Object.assign({},e,{user:t.user,error:"",state:o.CognitoState.NEW_PASSWORD_REQUIRED});case"COGNITO_USER_UNCONFIRMED":return Object.assign({},e,{user:t.user,state:o.CognitoState.CONFIRMATION_REQUIRED,cache:{userName:t.user.username,email:t.email?t.email:e.cache.email}});case"COGNITO_USER_CONFIRM_FAILED":return Object.assign({},e,{user:t.user,state:o.CognitoState.CONFIRMATION_REQUIRED,error:t.error});case"COGNITO_NEW_PASSWORD_REQUIRED_FAILURE":return Object.assign({},e,{error:t.error,state:o.CognitoState.NEW_PASSWORD_REQUIRED});case"COGNITO_EMAIL_VERIFICATION_REQUIRED":return Object.assign({},e,c({error:"",state:o.CognitoState.EMAIL_VERIFICATION_REQUIRED},t.attributes));case"COGNITO_EMAIL_VERIFICATION_FAILED":return Object.assign({},e,c({error:t.error,state:o.CognitoState.EMAIL_VERIFICATION_REQUIRED},t.attributes));case"COGNITO_BEGIN_PASSWORD_RESET_FLOW":return Object.assign({},e,{error:t.error});case"COGNITO_CONTINUE_PASSWORD_RESET_FLOW":return e;case"COGNITO_FINISH_PASSWORD_RESET_FLOW":return e;case"COGNITO_UPDATE_USER_ATTRIBUTES":return Object.assign({},e,{attributes:Object.assign({},e.attributes,t.attributes),state:o.CognitoState.AUTHENTICATED});default:return e}}},function(e,t){"use strict";function n(e){return function(){return e}}var r=function(){};r.thatReturns=n,r.thatReturnsFalse=n(!1),r.thatReturnsTrue=n(!0),r.thatReturnsNull=n(null),r.thatReturnsThis=function(){return this},r.thatReturnsArgument=function(e){return e},e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i,u,c,s){if(o(t),!e){var a;if(void 0===t)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var f=[n,r,i,u,c,s],l=0;a=new Error(t.replace(/%s/g,function(){return f[l++]})),a.name="Invariant Violation"}throw a.framesToPop=1,a}}var o=function(e){};e.exports=r},function(e,t,n){"use strict";var r=n(19),o=n(20),i=n(23);e.exports=function(){function e(e,t,n,r,u,c){c!==i&&o(!1,"Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types")}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){e.exports=n(21)()},function(e,t){"use strict";var n="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";e.exports=n}])}); +//# sourceMappingURL=react-cognito.min.js.map \ No newline at end of file diff --git a/dist/react-cognito.min.js.map b/dist/react-cognito.min.js.map new file mode 100644 index 0000000..26e2d75 --- /dev/null +++ b/dist/react-cognito.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["webpack:///webpack/universalModuleDefinition","webpack:///react-cognito.min.js","webpack:///webpack/bootstrap f32791e1b57892a236fd","webpack:///./src/index.js","webpack:///./src/actions.js","webpack:///external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}","webpack:///external {\"root\":\"ReactRedux\",\"commonjs\":\"react-redux\",\"commonjs2\":\"react-redux\",\"amd\":\"react-redux\"}","webpack:///./src/attributes.js","webpack:///./src/auth.js","webpack:///./src/states.js","webpack:///external {\"root\":\"AmazonCognitoIdentity\",\"commonjs2\":\"amazon-cognito-identity-js\",\"commonjs\":\"amazon-cognito-identity-js\",\"amd\":\"amazon-cognito-identity-js\"}","webpack:///./src/utils.js","webpack:///external \"aws-sdk/global\"","webpack:///./src/Confirm.jsx","webpack:///./src/EmailVerification.jsx","webpack:///./src/Login.jsx","webpack:///./src/Logout.jsx","webpack:///./src/NewPasswordRequired.jsx","webpack:///./src/PasswordReset.jsx","webpack:///./src/guard.js","webpack:///./src/policy.js","webpack:///./src/reducers.js","webpack:///./~/fbjs/lib/emptyFunction.js","webpack:///./~/fbjs/lib/invariant.js","webpack:///./~/prop-types/factoryWithThrowingShims.js","webpack:///./~/prop-types/index.js","webpack:///./~/prop-types/lib/ReactPropTypesSecret.js"],"names":["root","factory","exports","module","require","define","amd","this","__WEBPACK_EXTERNAL_MODULE_2__","__WEBPACK_EXTERNAL_MODULE_3__","__WEBPACK_EXTERNAL_MODULE_7__","__WEBPACK_EXTERNAL_MODULE_9__","modules","__webpack_require__","moduleId","installedModules","id","loaded","call","m","c","p","Object","defineProperty","value","_reducers","keys","forEach","key","enumerable","get","_actions","_states","_utils","_guard","_auth","_attributes","_policy","_Login","_Logout","_NewPasswordRequired","_EmailVerification","_PasswordReset","_Confirm","Action","configure","config","type","authenticated","user","loggingIn","attributes","login","creds","groups","logout","partialLogout","loginFailure","error","mfaRequired","newPasswordRequired","newPasswordRequiredFailure","emailVerificationRequired","emailVerificationFailed","beginPasswordResetFlow","continuePasswordResetFlow","finishPasswordResetFlow","updateAttributes","confirmationRequired","email","confirmFailed","clearCache","mkAttrList","getUserAttributes","sendAttributeVerificationCode","undefined","attribute","Promise","resolve","reject","getAttributeVerificationCode","onSuccess","inputVerificationCode","onFailure","message","result","i","length","name","getName","getValue","map","Name","Value","attributeList","err","emailVerificationFlow","registerUser","performLogin","authenticate","_amazonCognitoIdentityJs","_global","then","required","refreshIdentityCredentials","username","jwtToken","logins","buildLogins","CognitoIdentityCredentials","region","refresh","group","getSession","session","getIdToken","getJwtToken","getGroups","includes","identityPool","getUsername","password","userPool","dispatch","AuthenticationDetails","Username","Password","CognitoUser","Pool","authenticateUser","code","signUp","userConfirmed","CognitoState","LOGGED_OUT","AUTHENTICATED","LOGGING_IN","LOGGED_IN","NEW_PASSWORD_REQUIRED","MFA_REQUIRED","EMAIL_VERIFICATION_REQUIRED","CONFIRMATION_REQUIRED","changePassword","oldPassword","newPassword","loginDomain","loginUrl","IdentityPoolId","Logins","LoginId","payload","split","decodedToken","JSON","parse","util","base64","decode","toString","_interopRequireDefault","obj","__esModule","default","Confirm","_react","_react2","_reactRedux","BaseConfirm","props","cloneElement","children","onSubmit","onResend","onCancel","confirm","verificationCode","confirmRegistration","resend","resendConfirmationCode","mapStateToProps","state","cognito","mapDispatchToProps","confirmPartial","onResendPartial","mergeProps","stateProps","dispatchProps","ownProps","assign","connect","EmailVerification","verifyEmail","BaseEmailVerification","verifyAttribute","verifyPartial","Login","BaseLogin","userName","cache","authenticator","_classCallCheck","instance","Constructor","TypeError","_possibleConstructorReturn","self","ReferenceError","_inherits","subClass","superClass","prototype","create","constructor","writable","configurable","setPrototypeOf","__proto__","Logout","_createClass","defineProperties","target","descriptor","protoProps","staticProps","_propTypes","_propTypes2","_React$Component","_ref","_temp","_this","_ret","_len","arguments","args","Array","_key","getPrototypeOf","apply","concat","onClick","event","store","context","getState","signOut","preventDefault","onLogout","Component","contextTypes","object","propTypes","any","isRequired","func","defaultProps","NewPasswordRequired","BaseNewPasswordRequired","setNewPassword","userAttributes","completeNewPasswordChallenge","setNewPasswordPartial","PasswordReset","BasePasswordReset","sendVerificationCode","setPassword","getUser","confirmPassword","forgotPassword","sendVerificationCodePartial","setPasswordPartial","testLoggedIn","wantLoggedIn","isLoggedIn","permitted","expr","loggedIn","guard","forbiddenUrl","replace","callback","dest","allow","createGuard","identityPoolLogin","fetchAttributes","direct","enable","setupCognito","f","params","subscribe","email_verified","listeners","initial","clientId","action","AWS","pool","CognitoUserPool","UserPoolId","ClientId","getCurrentUser","addAttributes","s","s2","makeEmptyFunction","arg","emptyFunction","thatReturns","thatReturnsFalse","thatReturnsTrue","thatReturnsNull","thatReturnsThis","thatReturnsArgument","invariant","condition","format","a","b","d","e","validateFormat","Error","argIndex","framesToPop","ReactPropTypesSecret","shim","propName","componentName","location","propFullName","secret","getShim","ReactPropTypes","array","bool","number","string","symbol","arrayOf","element","instanceOf","node","objectOf","oneOf","oneOfType","shape","exact","checkPropTypes","PropTypes"],"mappings":"CAAA,SAAAA,EAAAC,GACA,gBAAAC,UAAA,gBAAAC,QACAA,OAAAD,QAAAD,EAAAG,QAAA,SAAAA,QAAA,eAAAA,QAAA,8BAAAA,QAAA,mBACA,kBAAAC,gBAAAC,IACAD,QAAA,qEAAAJ,GACA,gBAAAC,SACAA,QAAA,aAAAD,EAAAG,QAAA,SAAAA,QAAA,eAAAA,QAAA,8BAAAA,QAAA,mBAEAJ,EAAA,aAAAC,EAAAD,EAAA,MAAAA,EAAA,WAAAA,EAAA,sBAAAA,EAAA,o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C,EAAA,CACA1Q,GAAA,GAAAyQ,OAAAN,EAAAtC,QAAA,iBACA,MAAA7C,GAAA0F,QAEA1Q,EAAA8B,KAAA,sBAIA,KADA9B,GAAA2Q,YAAA,EACA3Q,GA3BA,GAAAwQ,GAAA,SAAAL,IA+BA1T,GAAAD,QAAAyT,GtBsyDM,SAAUxT,EAAQD,EAASW,GuBn1DjC,YAEA,IAAAuS,GAAAvS,EAAA,IACA8S,EAAA9S,EAAA,IACAyT,EAAAzT,EAAA,GAEAV,GAAAD,QAAA,WACA,QAAAqU,GAAA/J,EAAAgK,EAAAC,EAAAC,EAAAC,EAAAC,GACAA,IAAAN,GAIAX,GACA,EACA,mLAMA,QAAAkB,KACA,MAAAN,GAFAA,EAAA1E,WAAA0E,CAMA,IAAAO,IACAC,MAAAR,EACAS,KAAAT,EACAzE,KAAAyE,EACAU,OAAAV,EACA7E,OAAA6E,EACAW,OAAAX,EACAY,OAAAZ,EAEA3E,IAAA2E,EACAa,QAAAP,EACAQ,QAAAd,EACAe,WAAAT,EACAU,KAAAhB,EACAiB,SAAAX,EACAY,MAAAZ,EACAa,UAAAb,EACAc,MAAAd,EACAe,MAAAf,EAMA,OAHAC,GAAAe,eAAAzC,EACA0B,EAAAgB,UAAAhB,EAEAA,IvBk2DM,SAAU3U,EAAQD,EAASW,GwBh4DjCV,EAAAD,QAAAW,EAAA,OxBk6DM,SAAUV,EAAQD,GyBr7DxB,YAEA,IAAAoU,GAAA,8CAEAnU,GAAAD,QAAAoU","file":"react-cognito.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-redux\"), require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-redux\", \"amazon-cognito-identity-js\", \"aws-sdk/global\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactCognito\"] = factory(require(\"react\"), require(\"react-redux\"), require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"));\n\telse\n\t\troot[\"ReactCognito\"] = factory(root[\"React\"], root[\"ReactRedux\"], root[\"AmazonCognitoIdentity\"], root[\"aws-sdk/global\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_9__) {\nreturn \n\n\n// WEBPACK FOOTER //\n// webpack/universalModuleDefinition","(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"react\"), require(\"react-redux\"), require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"react\", \"react-redux\", \"amazon-cognito-identity-js\", \"aws-sdk/global\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"ReactCognito\"] = factory(require(\"react\"), require(\"react-redux\"), require(\"amazon-cognito-identity-js\"), require(\"aws-sdk/global\"));\n\telse\n\t\troot[\"ReactCognito\"] = factory(root[\"React\"], root[\"ReactRedux\"], root[\"AmazonCognitoIdentity\"], root[\"aws-sdk/global\"]);\n})(this, function(__WEBPACK_EXTERNAL_MODULE_2__, __WEBPACK_EXTERNAL_MODULE_3__, __WEBPACK_EXTERNAL_MODULE_7__, __WEBPACK_EXTERNAL_MODULE_9__) {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId])\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\texports: {},\n/******/ \t\t\tid: moduleId,\n/******/ \t\t\tloaded: false\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.loaded = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(0);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\tvar _reducers = __webpack_require__(18);\n\t\n\tObject.keys(_reducers).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _reducers[key];\n\t }\n\t });\n\t});\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tObject.keys(_actions).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _actions[key];\n\t }\n\t });\n\t});\n\t\n\tvar _states = __webpack_require__(6);\n\t\n\tObject.keys(_states).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _states[key];\n\t }\n\t });\n\t});\n\t\n\tvar _utils = __webpack_require__(8);\n\t\n\tObject.keys(_utils).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _utils[key];\n\t }\n\t });\n\t});\n\t\n\tvar _guard = __webpack_require__(16);\n\t\n\tObject.keys(_guard).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _guard[key];\n\t }\n\t });\n\t});\n\t\n\tvar _auth = __webpack_require__(5);\n\t\n\tObject.keys(_auth).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _auth[key];\n\t }\n\t });\n\t});\n\t\n\tvar _attributes = __webpack_require__(4);\n\t\n\tObject.keys(_attributes).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _attributes[key];\n\t }\n\t });\n\t});\n\t\n\tvar _policy = __webpack_require__(17);\n\t\n\tObject.keys(_policy).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _policy[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Login = __webpack_require__(12);\n\t\n\tObject.keys(_Login).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Login[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Logout = __webpack_require__(13);\n\t\n\tObject.keys(_Logout).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Logout[key];\n\t }\n\t });\n\t});\n\t\n\tvar _NewPasswordRequired = __webpack_require__(14);\n\t\n\tObject.keys(_NewPasswordRequired).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _NewPasswordRequired[key];\n\t }\n\t });\n\t});\n\t\n\tvar _EmailVerification = __webpack_require__(11);\n\t\n\tObject.keys(_EmailVerification).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _EmailVerification[key];\n\t }\n\t });\n\t});\n\t\n\tvar _PasswordReset = __webpack_require__(15);\n\t\n\tObject.keys(_PasswordReset).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _PasswordReset[key];\n\t }\n\t });\n\t});\n\t\n\tvar _Confirm = __webpack_require__(10);\n\t\n\tObject.keys(_Confirm).forEach(function (key) {\n\t if (key === \"default\" || key === \"__esModule\") return;\n\t Object.defineProperty(exports, key, {\n\t enumerable: true,\n\t get: function get() {\n\t return _Confirm[key];\n\t }\n\t });\n\t});\n\n/***/ }),\n/* 1 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t/**\r\n\t * container for all the actions\r\n\t*/\n\tvar Action = {\n\t\n\t configure: function configure(config) {\n\t return {\n\t type: 'COGNITO_CONFIGURE',\n\t config: config\n\t };\n\t },\n\t\n\t authenticated: function authenticated(user) {\n\t return {\n\t type: 'COGNITO_AUTHENTICATED',\n\t user: user\n\t };\n\t },\n\t\n\t loggingIn: function loggingIn(attributes) {\n\t return {\n\t type: 'COGNITO_LOGGING_IN',\n\t attributes: attributes\n\t };\n\t },\n\t\n\t login: function login(creds, attributes, groups) {\n\t return {\n\t type: 'COGNITO_LOGIN',\n\t creds: creds,\n\t groups: groups,\n\t attributes: attributes\n\t };\n\t },\n\t\n\t logout: function logout() {\n\t return {\n\t type: 'COGNITO_LOGOUT'\n\t };\n\t },\n\t\n\t partialLogout: function partialLogout() {\n\t return {\n\t type: 'COGNITO_PARTIAL_LOGOUT'\n\t };\n\t },\n\t\n\t loginFailure: function loginFailure(user, error) {\n\t return {\n\t type: 'COGNITO_LOGIN_FAILURE',\n\t user: user,\n\t error: error\n\t };\n\t },\n\t\n\t mfaRequired: function mfaRequired(user) {\n\t return {\n\t type: 'COGNITO_LOGIN_MFA_REQUIRED',\n\t user: user\n\t };\n\t },\n\t\n\t newPasswordRequired: function newPasswordRequired(user) {\n\t return {\n\t type: 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED',\n\t user: user\n\t };\n\t },\n\t\n\t newPasswordRequiredFailure: function newPasswordRequiredFailure(user, error) {\n\t return {\n\t type: 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE',\n\t user: user,\n\t error: error\n\t };\n\t },\n\t\n\t emailVerificationRequired: function emailVerificationRequired(attributes) {\n\t return {\n\t type: 'COGNITO_EMAIL_VERIFICATION_REQUIRED',\n\t attributes: attributes\n\t };\n\t },\n\t\n\t emailVerificationFailed: function emailVerificationFailed(user, error) {\n\t return {\n\t type: 'COGNITO_EMAIL_VERIFICATION_FAILED',\n\t user: user,\n\t error: error\n\t };\n\t },\n\t\n\t beginPasswordResetFlow: function beginPasswordResetFlow(user, error) {\n\t return {\n\t type: 'COGNITO_BEGIN_PASSWORD_RESET_FLOW',\n\t user: user,\n\t error: error\n\t };\n\t },\n\t\n\t continuePasswordResetFlow: function continuePasswordResetFlow(user) {\n\t return {\n\t type: 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW',\n\t user: user\n\t };\n\t },\n\t\n\t finishPasswordResetFlow: function finishPasswordResetFlow(error) {\n\t return {\n\t type: 'COGNITO_FINISH_PASSWORD_RESET_FLOW',\n\t error: error\n\t };\n\t },\n\t\n\t updateAttributes: function updateAttributes(attributes) {\n\t return {\n\t type: 'COGNITO_UPDATE_USER_ATTRIBUTES',\n\t attributes: attributes\n\t };\n\t },\n\t\n\t confirmationRequired: function confirmationRequired(user, email) {\n\t return {\n\t type: 'COGNITO_USER_UNCONFIRMED',\n\t user: user,\n\t email: email\n\t };\n\t },\n\t\n\t confirmFailed: function confirmFailed(user, error) {\n\t return {\n\t type: 'COGNITO_USER_CONFIRM_FAILED',\n\t user: user,\n\t error: error\n\t };\n\t },\n\t\n\t clearCache: function clearCache() {\n\t return {\n\t type: 'COGNITO_CLEAR_CACHE'\n\t };\n\t }\n\t};\n\t\n\texports.Action = Action;\n\n/***/ }),\n/* 2 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n/***/ }),\n/* 3 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n/***/ }),\n/* 4 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.mkAttrList = exports.updateAttributes = exports.getUserAttributes = exports.sendAttributeVerificationCode = undefined;\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\t/**\r\n\t * Request that a verification code is sent by email or SMS to verify\r\n\t * an attribute\r\n\t * @param {object} user - the cognito user object\r\n\t * @param {string} attribute - the attribute name\r\n\t*/\n\tvar sendAttributeVerificationCode = function sendAttributeVerificationCode(user, attribute) {\n\t return new Promise(function (resolve, reject) {\n\t user.getAttributeVerificationCode(attribute, {\n\t onSuccess: function onSuccess() {\n\t return resolve(false);\n\t },\n\t inputVerificationCode: function inputVerificationCode() {\n\t return resolve(true);\n\t },\n\t onFailure: function onFailure(error) {\n\t return reject(error.message);\n\t }\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * Fetches the user attributes from Cognito, and turns them into\r\n\t * an object\r\n\t * @param {object} user - the cognito user object\r\n\t * @returns {Promise} resolves with the attributes or rejects with an error message\r\n\t*/\n\tvar getUserAttributes = function getUserAttributes(user) {\n\t return new Promise(function (resolve, reject) {\n\t return user.getUserAttributes(function (error, result) {\n\t if (error) {\n\t reject(error.message);\n\t } else {\n\t var attributes = {};\n\t for (var i = 0; i < result.length; i += 1) {\n\t var name = result[i].getName();\n\t var value = result[i].getValue();\n\t attributes[name] = value;\n\t }\n\t resolve(attributes);\n\t }\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * convert an attribute dictionary to an attribute list\r\n\t * @param {object} attributes - a dictionary of attributes\r\n\t * @return {array} AWS expected attribute list\r\n\t*/\n\tvar mkAttrList = function mkAttrList(attributes) {\n\t return Object.keys(attributes).map(function (key) {\n\t return {\n\t Name: key,\n\t Value: attributes[key]\n\t };\n\t });\n\t};\n\t\n\t/**\r\n\t * update the attributes in Cognito\r\n\t * @param {object} user - the CognitoUser object\r\n\t * @param {object} attributes - an attributes dictionary with the attributes to be updated\r\n\t * @return {Promise} a promise that resolves to a redux action\r\n\t*/\n\tvar updateAttributes = function updateAttributes(user, attributes) {\n\t return new Promise(function (resolve, reject) {\n\t var attributeList = mkAttrList(attributes);\n\t user.updateAttributes(attributeList, function (err) {\n\t if (err) {\n\t reject(err.message);\n\t } else {\n\t resolve(_actions.Action.updateAttributes(attributes));\n\t }\n\t });\n\t });\n\t};\n\t\n\texports.sendAttributeVerificationCode = sendAttributeVerificationCode;\n\texports.getUserAttributes = getUserAttributes;\n\texports.updateAttributes = updateAttributes;\n\texports.mkAttrList = mkAttrList;\n\n/***/ }),\n/* 5 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.emailVerificationFlow = exports.registerUser = exports.performLogin = exports.authenticate = undefined;\n\t\n\tvar _amazonCognitoIdentityJs = __webpack_require__(7);\n\t\n\tvar _global = __webpack_require__(9);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tvar _attributes = __webpack_require__(4);\n\t\n\tvar _utils = __webpack_require__(8);\n\t\n\t/**\r\n\t * sends the email verification code and transitions to the correct state\r\n\t * @param {object} user - the CognitoUser object\r\n\t * @param {object} attributes - the attributes dictionary\r\n\t * @return {Promise} a promise that resolves to a redux action\r\n\t*/\n\tvar emailVerificationFlow = function emailVerificationFlow(user, attributes) {\n\t return new Promise(function (resolve) {\n\t return (0, _attributes.sendAttributeVerificationCode)(user, 'email').then(function (required) {\n\t if (required) {\n\t resolve(_actions.Action.emailVerificationRequired(attributes));\n\t } else {\n\t // dead end?\n\t resolve(_actions.Action.loggingIn(attributes));\n\t }\n\t }, function (error) {\n\t // some odd classes of error here\n\t resolve(_actions.Action.emailVerificationFailed(error, attributes));\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * logs in to the federated identity pool with a JWT\r\n\t * @param {string} username - the username\r\n\t * @param {string} jwtToken - a token from the session\r\n\t * @param {object} config - the react-cognito config\r\n\t * @return {Promise} a promise that resolves to the federated identity credentials\r\n\t*/\n\tvar refreshIdentityCredentials = function refreshIdentityCredentials(username, jwtToken, config) {\n\t return new Promise(function (resolve, reject) {\n\t var logins = (0, _utils.buildLogins)(username, jwtToken, config);\n\t var creds = new _global.CognitoIdentityCredentials(logins, { region: config.region });\n\t creds.refresh(function (error) {\n\t if (error) {\n\t reject(error.message);\n\t } else {\n\t resolve(creds);\n\t }\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * establishes a session with the user pool, and optionally logs into the federated identity\r\n\t * pool using a token from the session.\r\n\t * @param {object} user - the CognitoUser object\r\n\t * @param {object} config -the react-cognito config\r\n\t * @return {Promise} an action to be dispatched\r\n\t*/\n\tvar performLogin = function performLogin(user, config, group) {\n\t return new Promise(function (resolve, reject) {\n\t if (user === null) {\n\t resolve(_actions.Action.logout());\n\t } else {\n\t user.getSession(function (err, session) {\n\t if (err) {\n\t resolve(_actions.Action.loginFailure(user, err.message));\n\t } else {\n\t var jwtToken = session.getIdToken().getJwtToken();\n\t var groups = (0, _utils.getGroups)(jwtToken);\n\t if (group && !groups.includes(group)) {\n\t return resolve(_actions.Action.loginFailure(user, 'Insufficient privilege'));\n\t }\n\t\n\t if (config.identityPool) {\n\t var username = user.getUsername();\n\t refreshIdentityCredentials(username, jwtToken, config).then(function (creds) {\n\t (0, _attributes.getUserAttributes)(user).then(function (attributes) {\n\t resolve(_actions.Action.login(creds, attributes, groups));\n\t });\n\t }, function (message) {\n\t return resolve(_actions.Action.loginFailure(user, message));\n\t });\n\t } else {\n\t (0, _attributes.getUserAttributes)(user).then(function (attributes) {\n\t resolve(_actions.Action.login(null, attributes, groups));\n\t });\n\t }\n\t }\n\t });\n\t }\n\t });\n\t};\n\t\n\t/**\r\n\t *\r\n\t * Authenticates with a user pool, and handles responses.\r\n\t * if the authentication is successful it then logs in to the\r\n\t * identity pool if provided in config.\r\n\t *\r\n\t * returns an action depending on the outcome. Possible actions returned\r\n\t * are:\r\n\t *\r\n\t * - login - valid user who is logged in\r\n\t * - loginFailure - failed to authenticate with user pool or identity pool\r\n\t * - mfaRequired - user now needs to enter MFA\r\n\t * - newPasswordRequired - user must change password on first login\r\n\t * - emailVerificationRequired - user must verify their email address\r\n\t * - emailVerificationFailed - email verification is required, but won't work\r\n\t *\r\n\t * Dispatch the resulting action, e.g.:\r\n\t *\r\n\t * ```\r\n\t * const { userPool, config } = state.cognito;\r\n\t * authenticate(username, password, userPool, config).then(dispatch);\r\n\t * ```\r\n\t *\r\n\t * @param {string} username - the username provided by the user\r\n\t * @param {string} password - the password provided by the user\r\n\t * @param {object} userPool - a Cognito User Pool object\r\n\t * @return {Promise} - a promise that resolves an action to be dispatched\r\n\t *\r\n\t*/\n\tvar authenticate = function authenticate(username, password, userPool, config, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t var creds = new _amazonCognitoIdentityJs.AuthenticationDetails({\n\t Username: username,\n\t Password: password\n\t });\n\t\n\t var user = new _amazonCognitoIdentityJs.CognitoUser({\n\t Username: username,\n\t Pool: userPool\n\t });\n\t\n\t user.authenticateUser(creds, {\n\t onSuccess: function onSuccess() {\n\t dispatch(_actions.Action.authenticated(user));\n\t resolve();\n\t },\n\t onFailure: function onFailure(error) {\n\t if (error.code === 'UserNotConfirmedException') {\n\t dispatch(_actions.Action.confirmationRequired(user));\n\t resolve();\n\t } else {\n\t dispatch(_actions.Action.loginFailure(user, error.message));\n\t reject(error);\n\t }\n\t },\n\t mfaRequired: function mfaRequired() {\n\t dispatch(_actions.Action.mfaRequired(user));\n\t resolve();\n\t },\n\t newPasswordRequired: function newPasswordRequired() {\n\t dispatch(_actions.Action.newPasswordRequired(user));\n\t resolve();\n\t }\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * sign up this user with the user pool provided\r\n\t * @param {object} userPool - a Cognito userpool (e.g. state.cognito.userPool)\r\n\t * @param {object} config - the react-cognito config object\r\n\t * @param {string} username - the username\r\n\t * @param {string} password - the password\r\n\t * @param {object} attributes - an attributes dictionary\r\n\t * @return {Promise} a promise that resolves a redux action\r\n\t*/\n\tvar registerUser = function registerUser(userPool, config, username, password, attributes) {\n\t return new Promise(function (resolve, reject) {\n\t return userPool.signUp(username, password, (0, _attributes.mkAttrList)(attributes), null, function (err, result) {\n\t if (err) {\n\t reject(err.message);\n\t } else if (result.userConfirmed === false) {\n\t resolve(_actions.Action.confirmationRequired(result.user, attributes.email));\n\t } else {\n\t resolve(authenticate(username, password, userPool));\n\t }\n\t });\n\t });\n\t};\n\t\n\texports.authenticate = authenticate;\n\texports.performLogin = performLogin;\n\texports.registerUser = registerUser;\n\texports.emailVerificationFlow = emailVerificationFlow;\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\t/** states stored in store.cognito.state */\n\tvar CognitoState = exports.CognitoState = {\n\t LOGGED_OUT: 'LOGGED_OUT',\n\t AUTHENTICATED: 'AUTHENTICATED',\n\t LOGGING_IN: 'LOGGING_IN',\n\t LOGGED_IN: 'LOGGED_IN',\n\t NEW_PASSWORD_REQUIRED: 'NEW_PASSWORD_REQUIRED',\n\t MFA_REQUIRED: 'MFA_REQUIRED',\n\t EMAIL_VERIFICATION_REQUIRED: 'EMAIL_VERIFICATION_REQUIRED',\n\t CONFIRMATION_REQUIRED: 'CONFIRMATION_REQUIRED'\n\t};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_7__;\n\n/***/ }),\n/* 8 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.getGroups = exports.buildLogins = exports.changePassword = undefined;\n\t\n\tvar _global = __webpack_require__(9);\n\t\n\t/**\r\n\t * Change a user's password\r\n\t * @param {object} user - the cognito user object\r\n\t * @param {string} oldPassword - the current password\r\n\t * @param {string} newPassword - the new password\r\n\t*/\n\tvar changePassword = function changePassword(user, oldPassword, newPassword) {\n\t return new Promise(function (resolve, reject) {\n\t return user.changePassword(oldPassword, newPassword, function (err, result) {\n\t if (err) {\n\t reject(err.message);\n\t } else {\n\t resolve(result);\n\t }\n\t });\n\t });\n\t};\n\t\n\t/**\r\n\t * builds the federated identity pool login structure\r\n\t * @param {string} username - the username of the user\r\n\t * @param {string} jwtToken - a JWT Token from the session\r\n\t * @param {object} config - the cognito react config object\r\n\t*/\n\tvar buildLogins = function buildLogins(username, jwtToken, config) {\n\t var loginDomain = 'cognito-idp.' + config.region + '.amazonaws.com';\n\t var loginUrl = loginDomain + '/' + config.userPool;\n\t var creds = {\n\t IdentityPoolId: config.identityPool,\n\t Logins: {},\n\t LoginId: username // https://github.com/aws/aws-sdk-js/issues/609\n\t };\n\t creds.Logins[loginUrl] = jwtToken;\n\t return creds;\n\t};\n\t\n\t/**\r\n\t * Decode a jwtToken to check for cognito:groups\r\n\t * @param {string} jwtToken - a JWT Token from the session\r\n\t */\n\tvar getGroups = function getGroups(jwtToken) {\n\t var payload = jwtToken.split('.')[1];\n\t var decodedToken = JSON.parse(_global.util.base64.decode(payload).toString('utf8'));\n\t // decodedToken['cognito:groups'] can be undefined if user is in no groups\n\t if (!decodedToken['cognito:groups']) {\n\t return [];\n\t }\n\t return decodedToken['cognito:groups'];\n\t};\n\t\n\texports.changePassword = changePassword;\n\texports.buildLogins = buildLogins;\n\texports.getGroups = getGroups;\n\n/***/ }),\n/* 9 */\n/***/ (function(module, exports) {\n\n\tmodule.exports = __WEBPACK_EXTERNAL_MODULE_9__;\n\n/***/ }),\n/* 10 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Confirm = undefined;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactRedux = __webpack_require__(3);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BaseConfirm = function BaseConfirm(props) {\n\t return _react2.default.cloneElement(props.children, {\n\t error: props.error,\n\t onSubmit: props.onSubmit,\n\t onResend: props.onResend,\n\t onCancel: props.onCancel\n\t });\n\t};\n\t\n\tvar confirm = function confirm(verificationCode, user, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t user.confirmRegistration(verificationCode, true, function (error) {\n\t if (error) {\n\t dispatch(_actions.Action.confirmFailed(user));\n\t reject(error.message);\n\t } else {\n\t dispatch(_actions.Action.partialLogout());\n\t resolve(user);\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar resend = function resend(user, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t user.resendConfirmationCode(function (err) {\n\t if (err) {\n\t dispatch(_actions.Action.confirmationRequired(user));\n\t reject(err.message);\n\t } else {\n\t dispatch(_actions.Action.confirmationRequired(user));\n\t resolve(user);\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar mapStateToProps = function mapStateToProps(state) {\n\t return {\n\t error: state.cognito.error,\n\t user: state.cognito.user\n\t };\n\t};\n\t\n\tvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n\t return {\n\t confirmPartial: function confirmPartial(verificationCode, user) {\n\t return confirm(verificationCode, user, dispatch);\n\t },\n\t onCancel: function onCancel() {\n\t return dispatch(_actions.Action.logout());\n\t },\n\t onResendPartial: function onResendPartial(user) {\n\t return resend(user, dispatch);\n\t }\n\t };\n\t};\n\t\n\tvar mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {\n\t return Object.assign({}, ownProps, stateProps, dispatchProps, {\n\t onSubmit: function onSubmit(verificationCode) {\n\t return dispatchProps.confirmPartial(verificationCode, stateProps.user);\n\t },\n\t onResend: function onResend() {\n\t return dispatchProps.onResendPartial(stateProps.user);\n\t }\n\t });\n\t};\n\t\n\t/**\r\n\t * Container for a confirmation form. Magically adds the following props to the \r\n\t * contained form:\r\n\t *\r\n\t * * user - the Cognito User from the redux store\r\n\t * * error - the persisted error from the redux store\r\n\t * * onSubmit - a handler that calls the Cognito confirm API\r\n\t * * onResend - a handler that calls the Cognito resend request API\r\n\t * * onCancel - Logs the user out completely\r\n\t *\r\n\t * @example\r\n\t * \r\n\t * \r\n\t * \r\n\t *\r\n\t */\n\tvar Confirm = exports.Confirm = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseConfirm);\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.EmailVerification = exports.verifyEmail = undefined;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactRedux = __webpack_require__(3);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BaseEmailVerification = function BaseEmailVerification(props) {\n\t return _react2.default.cloneElement(props.children, {\n\t error: props.error,\n\t onSubmit: props.onSubmit,\n\t onCancel: props.onCancel\n\t });\n\t};\n\t\n\tvar verifyEmail = exports.verifyEmail = function verifyEmail(verificationCode, user, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t user.verifyAttribute('email', verificationCode, {\n\t onSuccess: function onSuccess() {\n\t dispatch(_actions.Action.login(user));\n\t resolve();\n\t },\n\t inputVerificationCode: function inputVerificationCode() {\n\t dispatch(_actions.Action.emailVerificationRequired(user));\n\t reject();\n\t },\n\t onFailure: function onFailure(error) {\n\t dispatch(_actions.Action.emailVerificationFailed(user, error.message));\n\t reject();\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar mapStateToProps = function mapStateToProps(state) {\n\t return {\n\t error: state.cognito.error,\n\t user: state.cognito.user\n\t };\n\t};\n\t\n\tvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n\t return {\n\t verifyPartial: function verifyPartial(verificationCode, user) {\n\t return verifyEmail(verificationCode, user, dispatch);\n\t },\n\t onCancel: function onCancel() {\n\t return dispatch(_actions.Action.logout());\n\t }\n\t };\n\t};\n\t\n\tvar mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {\n\t return Object.assign({}, ownProps, stateProps, dispatchProps, {\n\t onSubmit: function onSubmit(verificationCode) {\n\t return dispatchProps.verifyPartial(verificationCode, stateProps.user);\n\t }\n\t });\n\t};\n\t\n\t/**\r\n\t * Wrapper for an Email Verification Form.\r\n\t * Magically adds the following props to the contained form:\r\n\t *\r\n\t * * user - the Cognito user from the Redux store\r\n\t * * error - the persisted error from the Redux store\r\n\t * * onSubmit - a handler that calls the Cognito verification API\r\n\t *\r\n\t * @example\r\n\t * \r\n\t * \r\n\t * \r\n\t *\r\n\t */\n\tvar EmailVerification = exports.EmailVerification = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseEmailVerification);\n\n/***/ }),\n/* 12 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Login = undefined;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactRedux = __webpack_require__(3);\n\t\n\tvar _auth = __webpack_require__(5);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BaseLogin = function BaseLogin(props) {\n\t return _react2.default.cloneElement(props.children, {\n\t username: props.username,\n\t email: props.email,\n\t onSubmit: props.onSubmit,\n\t clearCache: props.clearCache,\n\t error: props.error\n\t });\n\t};\n\t\n\tvar mapStateToProps = function mapStateToProps(state) {\n\t var username = '';\n\t if (state.cognito.user) {\n\t username = state.cognito.user.getUsername();\n\t } else if (state.cognito.userName) {\n\t username = state.cognito.cache.userName;\n\t }\n\t return {\n\t username: username,\n\t email: state.cognito.cache.email,\n\t config: state.cognito.config,\n\t userPool: state.cognito.userPool,\n\t error: state.cognito.error\n\t };\n\t};\n\t\n\tvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n\t return {\n\t authenticator: function authenticator(username, password, userPool, config) {\n\t return (0, _auth.authenticate)(username, password, userPool, config, dispatch);\n\t },\n\t clearCache: function clearCache() {\n\t return dispatch(_actions.Action.clearCache());\n\t }\n\t };\n\t};\n\t\n\tvar mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {\n\t return Object.assign({}, ownProps, stateProps, {\n\t onSubmit: function onSubmit(username, password) {\n\t return dispatchProps.authenticator(username, password, stateProps.userPool, stateProps.config);\n\t },\n\t clearCache: dispatchProps.clearCache\n\t });\n\t};\n\t\n\t/**\r\n\t * Container for login behaviour, wrapping a login form.\r\n\t *\r\n\t * Magically provides the following props to the wrapped form:\r\n\t *\r\n\t * * username\r\n\t * * onSubmit\r\n\t *\r\n\t * @example\r\n\t * \r\n\t * \r\n\t * \r\n\t */\n\tvar Login = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseLogin);\n\t\n\texports.Login = Login;\n\n/***/ }),\n/* 13 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.Logout = undefined;\n\t\n\tvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _propTypes = __webpack_require__(22);\n\t\n\tvar _propTypes2 = _interopRequireDefault(_propTypes);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\t\n\tfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\t\n\tfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\t\n\t/**\r\n\t * Container for logout behaviour.\r\n\t * @example\r\n\t * \r\n\t * \r\n\t * \r\n\t */\n\tvar Logout = exports.Logout = function (_React$Component) {\n\t _inherits(Logout, _React$Component);\n\t\n\t function Logout() {\n\t var _ref;\n\t\n\t var _temp, _this, _ret;\n\t\n\t _classCallCheck(this, Logout);\n\t\n\t for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {\n\t args[_key] = arguments[_key];\n\t }\n\t\n\t return _ret = (_temp = (_this = _possibleConstructorReturn(this, (_ref = Logout.__proto__ || Object.getPrototypeOf(Logout)).call.apply(_ref, [this].concat(args))), _this), _this.onClick = function (event) {\n\t var store = _this.context.store;\n\t\n\t var state = store.getState();\n\t state.cognito.user.signOut();\n\t event.preventDefault();\n\t store.dispatch(_actions.Action.logout());\n\t _this.props.onLogout();\n\t }, _temp), _possibleConstructorReturn(_this, _ret);\n\t }\n\t\n\t /**\r\n\t * Passed to child element as onClick prop.\r\n\t * Signs the user out, and then dispatches the logout action\r\n\t * If you want to take further actions (like reloading UI) then add an\r\n\t * onLogout property to the Logout element\r\n\t */\n\t\n\t\n\t _createClass(Logout, [{\n\t key: 'render',\n\t\n\t\n\t /**\r\n\t * renders the child element, adding an onClick property\r\n\t */\n\t value: function render() {\n\t return _react2.default.cloneElement(this.props.children, {\n\t onClick: this.onClick\n\t });\n\t }\n\t }]);\n\t\n\t return Logout;\n\t}(_react2.default.Component);\n\t\n\tLogout.contextTypes = {\n\t store: _propTypes2.default.object\n\t};\n\tLogout.propTypes = {\n\t children: _propTypes2.default.any.isRequired,\n\t onLogout: _propTypes2.default.func\n\t};\n\tLogout.defaultProps = {\n\t onLogout: function onLogout() {}\n\t};\n\n/***/ }),\n/* 14 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.NewPasswordRequired = undefined;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactRedux = __webpack_require__(3);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BaseNewPasswordRequired = function BaseNewPasswordRequired(props) {\n\t return _react2.default.cloneElement(props.children, {\n\t error: props.error,\n\t onSubmit: props.onSubmit\n\t });\n\t};\n\t\n\tvar setNewPassword = function setNewPassword(password, user, config, userAttributes, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t user.completeNewPasswordChallenge(password, userAttributes, {\n\t onSuccess: function onSuccess() {\n\t dispatch(_actions.Action.authenticated(user));\n\t resolve();\n\t },\n\t onFailure: function onFailure(error) {\n\t dispatch(_actions.Action.newPasswordRequiredFailure(user, error.message));\n\t reject(error);\n\t },\n\t mfaRequired: function mfaRequired() {\n\t dispatch(_actions.Action.mfaRequired(user));\n\t resolve();\n\t },\n\t newPasswordRequired: function newPasswordRequired() {\n\t dispatch(_actions.Action.newPasswordRequired(user));\n\t resolve();\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar mapStateToProps = function mapStateToProps(state) {\n\t return {\n\t error: state.cognito.error,\n\t user: state.cognito.user,\n\t config: state.cognito.config\n\t };\n\t};\n\t\n\tvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n\t return {\n\t setNewPasswordPartial: function setNewPasswordPartial(password, user, config, userAttributes) {\n\t return setNewPassword(password, user, config, userAttributes, dispatch);\n\t }\n\t };\n\t};\n\t\n\tvar mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {\n\t return Object.assign({}, ownProps, stateProps, {\n\t onSubmit: function onSubmit(password, userAttributes) {\n\t return dispatchProps.setNewPasswordPartial(password, stateProps.user, stateProps.config, userAttributes);\n\t }\n\t });\n\t};\n\t\n\t/**\r\n\t * Wrapper for a New Password Required form\r\n\t *\r\n\t * Magically provides the following props to the wrapped element:\r\n\t *\r\n\t * * user - the Cognito user\r\n\t * * error - the persistent react-cognito error message\r\n\t * * onSubmit - a handler that calls the Set New Password API\r\n\t *\r\n\t * @example\r\n\t *\r\n\t * \r\n\t * \r\n\t * \r\n\t */\n\tvar NewPasswordRequired = exports.NewPasswordRequired = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BaseNewPasswordRequired);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.PasswordReset = undefined;\n\t\n\tvar _react = __webpack_require__(2);\n\t\n\tvar _react2 = _interopRequireDefault(_react);\n\t\n\tvar _reactRedux = __webpack_require__(3);\n\t\n\tvar _amazonCognitoIdentityJs = __webpack_require__(7);\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\t\n\tvar BasePasswordReset = function BasePasswordReset(props) {\n\t return _react2.default.cloneElement(props.children, {\n\t username: props.username,\n\t sendVerificationCode: props.sendVerificationCode,\n\t setPassword: props.setPassword\n\t });\n\t};\n\t\n\tvar getUser = function getUser(username, userPool) {\n\t var user = new _amazonCognitoIdentityJs.CognitoUser({\n\t Username: username,\n\t Pool: userPool\n\t });\n\t return user;\n\t};\n\t\n\tvar setPassword = function setPassword(username, userPool, code, password, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t var user = getUser(username, userPool);\n\t user.confirmPassword(code, password, {\n\t onSuccess: function onSuccess() {\n\t dispatch(_actions.Action.finishPasswordResetFlow()), resolve();\n\t },\n\t onFailure: function onFailure(err) {\n\t dispatch(_actions.Action.beginPasswordResetFlow(user, err.message)), reject(err);\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar sendVerificationCode = function sendVerificationCode(username, userPool, dispatch) {\n\t return new Promise(function (resolve, reject) {\n\t var user = getUser(username, userPool);\n\t user.forgotPassword({\n\t onSuccess: function onSuccess() {\n\t dispatch(_actions.Action.continuePasswordResetFlow(user));\n\t resolve();\n\t },\n\t onFailure: function onFailure(err) {\n\t dispatch(_actions.Action.beginPasswordResetFlow(user, err.message));\n\t reject(err);\n\t }\n\t });\n\t });\n\t};\n\t\n\tvar mapStateToProps = function mapStateToProps(state) {\n\t var props = {\n\t user: state.cognito.user,\n\t username: '',\n\t userPool: state.cognito.userPool\n\t };\n\t if (state.cognito.user != null) {\n\t props.username = state.cognito.user.getUsername();\n\t }\n\t return props;\n\t};\n\t\n\tvar mapDispatchToProps = function mapDispatchToProps(dispatch) {\n\t return {\n\t sendVerificationCodePartial: function sendVerificationCodePartial(username, userPool) {\n\t return sendVerificationCode(username, userPool, dispatch);\n\t },\n\t setPasswordPartial: function setPasswordPartial(user, userPool, code, password) {\n\t return setPassword(user, userPool, code, password, dispatch);\n\t }\n\t };\n\t};\n\t\n\tvar mergeProps = function mergeProps(stateProps, dispatchProps, ownProps) {\n\t return Object.assign({}, ownProps, stateProps, {\n\t sendVerificationCode: function sendVerificationCode(username) {\n\t return dispatchProps.sendVerificationCodePartial(username, stateProps.userPool);\n\t },\n\t setPassword: function setPassword(username, code, password) {\n\t return dispatchProps.setPasswordPartial(username, stateProps.userPool, code, password);\n\t }\n\t });\n\t};\n\t\n\t/**\r\n\t * Container for a Password Reset form\r\n\t *\r\n\t * Magically provides the following props to the wrapped element:\r\n\t *\r\n\t * * user\r\n\t * * username\r\n\t * * sendVerificationCode\r\n\t * * setPassword\r\n\t *\r\n\t * @example\r\n\t * \r\n\t * \r\n\t * \r\n\t */\n\tvar PasswordReset = exports.PasswordReset = (0, _reactRedux.connect)(mapStateToProps, mapDispatchToProps, mergeProps)(BasePasswordReset);\n\n/***/ }),\n/* 16 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\t\n\t/*\r\n\t Default behaviour is to restrict access to only logged in users\r\n\t*/\n\t\n\tvar testLoggedIn = function testLoggedIn(state, wantLoggedIn) {\n\t var isLoggedIn = state.cognito.user !== null;\n\t if (isLoggedIn && wantLoggedIn) {\n\t return true;\n\t }\n\t if (!isLoggedIn && !wantLoggedIn) {\n\t return true;\n\t }\n\t return false;\n\t};\n\t\n\tvar permitted = function permitted(state, expr) {\n\t return new Promise(function (resolve) {\n\t if (expr.loggedIn !== undefined) {\n\t resolve(testLoggedIn(state, expr.loggedIn));\n\t } else {\n\t resolve(testLoggedIn(state, true));\n\t }\n\t });\n\t};\n\t\n\tvar guard = function guard(store, forbiddenUrl) {\n\t var expr = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\t var routeState = arguments[3];\n\t var replace = arguments[4];\n\t var callback = arguments[5];\n\t\n\t var state = store.getState();\n\t var dest = forbiddenUrl;\n\t\n\t if (expr.forbiddenUrl !== undefined) {\n\t dest = expr.forbiddenUrl;\n\t }\n\t permitted(state, expr).then(function (allow) {\n\t if (!allow) {\n\t replace(dest);\n\t }\n\t callback();\n\t });\n\t};\n\t\n\t/**\r\n\t * creates a guard function you can use in tags\r\n\t * @param {object} store - the redux store\r\n\t * @param {string} forbiddenUrl - the default url to navigate to if forbidden\r\n\t * @returns {function} - a function that can be provided to onEnter\r\n\t*/\n\tvar createGuard = function createGuard(store, forbiddenUrl) {\n\t return function (expr) {\n\t return function (state, replace, callback) {\n\t return guard(store, forbiddenUrl, expr, state, replace, callback);\n\t };\n\t };\n\t};\n\t\n\texports.createGuard = createGuard;\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.identityPoolLogin = exports.emailVerificationRequired = exports.fetchAttributes = exports.direct = exports.enable = exports.setupCognito = undefined;\n\t\n\tvar _actions = __webpack_require__(1);\n\t\n\tvar _attributes = __webpack_require__(4);\n\t\n\tvar _auth = __webpack_require__(5);\n\t\n\tvar _states = __webpack_require__(6);\n\t\n\t/**\r\n\t * subscribes a \"policy\" function to the store, and calls it\r\n\t * with the state and the dispatch function\r\n\t * @param {object} store - the redux store\r\n\t * @param {function} f - f(state, dispatch)\r\n\t*/\n\tvar enable = function enable(store, f, params) {\n\t store.subscribe(function () {\n\t var state = store.getState();\n\t var dispatch = store.dispatch;\n\t f(state, dispatch, params);\n\t });\n\t};\n\t\n\t/**\r\n\t * requires email verification before transitioning from AUTHENTICATED\r\n\t * @param {object} state - the redux store state\r\n\t * @param {function} dispatch - the dispatch function\r\n\t*/\n\tvar emailVerificationRequired = function emailVerificationRequired(state, dispatch) {\n\t if (state.cognito.state === _states.CognitoState.AUTHENTICATED) {\n\t var user = state.cognito.user;\n\t (0, _attributes.getUserAttributes)(user).then(function (attributes) {\n\t if (attributes.email_verified !== 'true') {\n\t (0, _auth.emailVerificationFlow)(user, attributes).then(dispatch);\n\t } else {\n\t dispatch(_actions.Action.loggingIn(attributes));\n\t }\n\t });\n\t }\n\t};\n\t\n\t/**\r\n\t * fetches and stores attributes before transitioning from AUTHENTICATED\r\n\t * @param {object} state - the redux store state\r\n\t * @param {function} dispatch - the dispatch function\r\n\t*/\n\tvar fetchAttributes = function fetchAttributes(state, dispatch) {\n\t if (state.cognito.state === _states.CognitoState.AUTHENTICATED) {\n\t var user = state.cognito.user;\n\t (0, _attributes.getUserAttributes)(user).then(function (attributes) {\n\t dispatch(_actions.Action.loggingIn(attributes));\n\t });\n\t }\n\t};\n\t\n\t/**\r\n\t * transitions directly from AUTHENTICATED to LOGGING_IN\r\n\t * @param {object} state - the redux store state\r\n\t * @param {function} dispatch - the dispatch function\r\n\t*/\n\tvar direct = function direct(state, dispatch) {\n\t if (state.cognito.state === _states.CognitoState.AUTHENTICATED) {\n\t dispatch(_actions.Action.loggingIn());\n\t }\n\t};\n\t\n\t/**\r\n\t * logs into the single federated identity pool to transition from LOGGING_IN\r\n\t * to LOGGED_IN\r\n\t * @param {object} state - the redux store state\r\n\t * @param {function} dispatch - the dispatch function\r\n\t*/\n\tvar identityPoolLogin = function identityPoolLogin(state, dispatch, group) {\n\t if (state.cognito.state === _states.CognitoState.LOGGING_IN) {\n\t (0, _auth.performLogin)(state.cognito.user, state.cognito.config, group).then(dispatch);\n\t }\n\t};\n\t\n\t/**\r\n\t * sets up react-cognito with default policies.\r\n\t*/\n\tvar setupCognito = function setupCognito(store, config) {\n\t var listeners = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : [emailVerificationRequired, identityPoolLogin];\n\t\n\t store.dispatch(_actions.Action.configure(config));\n\t listeners.forEach(function (f) {\n\t enable(store, f, config.group);\n\t });\n\t store.dispatch(_actions.Action.loggingIn({}));\n\t};\n\t\n\texports.setupCognito = setupCognito;\n\texports.enable = enable;\n\texports.direct = direct;\n\texports.fetchAttributes = fetchAttributes;\n\texports.emailVerificationRequired = emailVerificationRequired;\n\texports.identityPoolLogin = identityPoolLogin;\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t'use strict';\n\t\n\tObject.defineProperty(exports, \"__esModule\", {\n\t value: true\n\t});\n\texports.cognito = undefined;\n\t\n\tvar _amazonCognitoIdentityJs = __webpack_require__(7);\n\t\n\tvar _states = __webpack_require__(6);\n\t\n\t/* global AWS */\n\t\n\tvar initial = {\n\t user: null,\n\t cache: { // cached for post register login\n\t userName: null,\n\t email: null\n\t },\n\t state: _states.CognitoState.LOGGED_OUT,\n\t error: '',\n\t userPool: null,\n\t attributes: {},\n\t creds: null,\n\t groups: [],\n\t config: {\n\t region: null,\n\t userPool: null,\n\t clientId: null,\n\t identityPool: null\n\t }\n\t};\n\t\n\tvar configure = function configure(state, action) {\n\t // surprise side-effect!\n\t AWS.config.region = action.config.region;\n\t var pool = new _amazonCognitoIdentityJs.CognitoUserPool({\n\t UserPoolId: action.config.userPool,\n\t ClientId: action.config.clientId\n\t });\n\t var user = pool.getCurrentUser();\n\t return Object.assign({}, state, {\n\t config: action.config,\n\t userPool: pool,\n\t user: user\n\t });\n\t};\n\t\n\t// sometimes we don't get the attributes in later parts of the login flow\n\t// but lets not clobber the ones we've got if we've not got them\n\tvar addAttributes = function addAttributes(s, attributes) {\n\t var s2 = Object.assign({}, s);\n\t if (attributes) {\n\t s2.attributes = attributes;\n\t }\n\t return s2;\n\t};\n\t\n\t/**\r\n\t * reducer function to be passed to redux combineReducers\r\n\t * @param {object} state\r\n\t * @param {object} action\r\n\t*/\n\t\n\tvar cognito = exports.cognito = function cognito() {\n\t var state = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initial;\n\t var action = arguments[1];\n\t\n\t switch (action.type) {\n\t\n\t case 'COGNITO_CONFIGURE':\n\t return configure(state, action);\n\t\n\t case 'COGNITO_AUTHENTICATED':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t cache: {\n\t userName: null,\n\t email: null\n\t },\n\t error: '',\n\t state: _states.CognitoState.AUTHENTICATED\n\t });\n\t\n\t case 'COGNITO_CLEAR_CACHE':\n\t return Object.assign({}, state, {\n\t cache: {\n\t userName: null,\n\t email: null\n\t }\n\t });\n\t\n\t case 'COGNITO_LOGGING_IN':\n\t return Object.assign({}, state, {\n\t state: _states.CognitoState.LOGGING_IN,\n\t attributes: action.attributes\n\t });\n\t\n\t case 'COGNITO_LOGIN':\n\t return Object.assign({}, state, addAttributes({\n\t error: '',\n\t creds: action.creds,\n\t groups: action.groups,\n\t state: _states.CognitoState.LOGGED_IN\n\t }, action.attributes));\n\t\n\t case 'COGNITO_LOGOUT':\n\t return Object.assign({}, state, {\n\t user: null,\n\t attributes: {},\n\t error: '',\n\t creds: null,\n\t groups: [],\n\t state: _states.CognitoState.LOGGED_OUT\n\t });\n\t\n\t case 'COGNITO_PARTIAL_LOGOUT':\n\t return Object.assign({}, state, {\n\t user: null,\n\t userName: state.user.username,\n\t error: '',\n\t creds: null,\n\t groups: [],\n\t state: _states.CognitoState.LOGGED_OUT\n\t });\n\t\n\t case 'COGNITO_LOGIN_FAILURE':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t state: _states.CognitoState.LOGGED_OUT,\n\t error: action.error\n\t });\n\t\n\t case 'COGNITO_LOGIN_MFA_REQUIRED':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t error: '',\n\t state: _states.CognitoState.MFA_REQUIRED\n\t });\n\t\n\t case 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t error: '',\n\t state: _states.CognitoState.NEW_PASSWORD_REQUIRED\n\t });\n\t\n\t case 'COGNITO_USER_UNCONFIRMED':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t state: _states.CognitoState.CONFIRMATION_REQUIRED,\n\t cache: {\n\t userName: action.user.username,\n\t email: action.email ? action.email : state.cache.email\n\t }\n\t });\n\t\n\t case 'COGNITO_USER_CONFIRM_FAILED':\n\t return Object.assign({}, state, {\n\t user: action.user,\n\t state: _states.CognitoState.CONFIRMATION_REQUIRED,\n\t error: action.error\n\t });\n\t\n\t case 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE':\n\t return Object.assign({}, state, {\n\t error: action.error,\n\t state: _states.CognitoState.NEW_PASSWORD_REQUIRED\n\t });\n\t\n\t case 'COGNITO_EMAIL_VERIFICATION_REQUIRED':\n\t return Object.assign({}, state, addAttributes({\n\t error: '',\n\t state: _states.CognitoState.EMAIL_VERIFICATION_REQUIRED\n\t }, action.attributes));\n\t\n\t case 'COGNITO_EMAIL_VERIFICATION_FAILED':\n\t return Object.assign({}, state, addAttributes({\n\t error: action.error,\n\t state: _states.CognitoState.EMAIL_VERIFICATION_REQUIRED\n\t }, action.attributes));\n\t\n\t case 'COGNITO_BEGIN_PASSWORD_RESET_FLOW':\n\t return Object.assign({}, state, {\n\t error: action.error\n\t });\n\t\n\t case 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW':\n\t return state;\n\t\n\t case 'COGNITO_FINISH_PASSWORD_RESET_FLOW':\n\t return state;\n\t\n\t // this moves us into the AUTHENTICATED state, potentially causing\n\t // a number of side-effects. this is so we can re-verify the email\n\t // address if we have to\n\t case 'COGNITO_UPDATE_USER_ATTRIBUTES':\n\t return Object.assign({}, state, {\n\t attributes: Object.assign({}, state.attributes, action.attributes),\n\t state: _states.CognitoState.AUTHENTICATED\n\t });\n\t\n\t default:\n\t return state;\n\t }\n\t};\n\n/***/ }),\n/* 19 */\n/***/ (function(module, exports) {\n\n\t\"use strict\";\n\t\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t *\n\t * This source code is licensed under the MIT license found in the\n\t * LICENSE file in the root directory of this source tree.\n\t *\n\t * \n\t */\n\t\n\tfunction makeEmptyFunction(arg) {\n\t return function () {\n\t return arg;\n\t };\n\t}\n\t\n\t/**\n\t * This function accepts and discards inputs; it has no side effects. This is\n\t * primarily useful idiomatically for overridable function endpoints which\n\t * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n\t */\n\tvar emptyFunction = function emptyFunction() {};\n\t\n\temptyFunction.thatReturns = makeEmptyFunction;\n\temptyFunction.thatReturnsFalse = makeEmptyFunction(false);\n\temptyFunction.thatReturnsTrue = makeEmptyFunction(true);\n\temptyFunction.thatReturnsNull = makeEmptyFunction(null);\n\temptyFunction.thatReturnsThis = function () {\n\t return this;\n\t};\n\temptyFunction.thatReturnsArgument = function (arg) {\n\t return arg;\n\t};\n\t\n\tmodule.exports = emptyFunction;\n\n/***/ }),\n/* 20 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t *\n\t * This source code is licensed under the MIT license found in the\n\t * LICENSE file in the root directory of this source tree.\n\t *\n\t */\n\t\n\t'use strict';\n\t\n\t/**\n\t * Use invariant() to assert state which your program assumes to be true.\n\t *\n\t * Provide sprintf-style format (only %s is supported) and arguments\n\t * to provide information about what broke and what you were\n\t * expecting.\n\t *\n\t * The invariant message will be stripped in production, but the invariant\n\t * will remain to ensure logic does not differ in production.\n\t */\n\t\n\tvar validateFormat = function validateFormat(format) {};\n\t\n\tif (false) {\n\t validateFormat = function validateFormat(format) {\n\t if (format === undefined) {\n\t throw new Error('invariant requires an error message argument');\n\t }\n\t };\n\t}\n\t\n\tfunction invariant(condition, format, a, b, c, d, e, f) {\n\t validateFormat(format);\n\t\n\t if (!condition) {\n\t var error;\n\t if (format === undefined) {\n\t error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n\t } else {\n\t var args = [a, b, c, d, e, f];\n\t var argIndex = 0;\n\t error = new Error(format.replace(/%s/g, function () {\n\t return args[argIndex++];\n\t }));\n\t error.name = 'Invariant Violation';\n\t }\n\t\n\t error.framesToPop = 1; // we don't care about invariant's own frame\n\t throw error;\n\t }\n\t}\n\t\n\tmodule.exports = invariant;\n\n/***/ }),\n/* 21 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t *\n\t * This source code is licensed under the MIT license found in the\n\t * LICENSE file in the root directory of this source tree.\n\t */\n\t\n\t'use strict';\n\t\n\tvar emptyFunction = __webpack_require__(19);\n\tvar invariant = __webpack_require__(20);\n\tvar ReactPropTypesSecret = __webpack_require__(23);\n\t\n\tmodule.exports = function() {\n\t function shim(props, propName, componentName, location, propFullName, secret) {\n\t if (secret === ReactPropTypesSecret) {\n\t // It is still safe when called from React.\n\t return;\n\t }\n\t invariant(\n\t false,\n\t 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n\t 'Use PropTypes.checkPropTypes() to call them. ' +\n\t 'Read more at http://fb.me/use-check-prop-types'\n\t );\n\t };\n\t shim.isRequired = shim;\n\t function getShim() {\n\t return shim;\n\t };\n\t // Important!\n\t // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n\t var ReactPropTypes = {\n\t array: shim,\n\t bool: shim,\n\t func: shim,\n\t number: shim,\n\t object: shim,\n\t string: shim,\n\t symbol: shim,\n\t\n\t any: shim,\n\t arrayOf: getShim,\n\t element: shim,\n\t instanceOf: getShim,\n\t node: shim,\n\t objectOf: getShim,\n\t oneOf: getShim,\n\t oneOfType: getShim,\n\t shape: getShim,\n\t exact: getShim\n\t };\n\t\n\t ReactPropTypes.checkPropTypes = emptyFunction;\n\t ReactPropTypes.PropTypes = ReactPropTypes;\n\t\n\t return ReactPropTypes;\n\t};\n\n\n/***/ }),\n/* 22 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t *\n\t * This source code is licensed under the MIT license found in the\n\t * LICENSE file in the root directory of this source tree.\n\t */\n\t\n\tif (false) {\n\t var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n\t Symbol.for &&\n\t Symbol.for('react.element')) ||\n\t 0xeac7;\n\t\n\t var isValidElement = function(object) {\n\t return typeof object === 'object' &&\n\t object !== null &&\n\t object.$$typeof === REACT_ELEMENT_TYPE;\n\t };\n\t\n\t // By explicitly using `prop-types` you are opting into new development behavior.\n\t // http://fb.me/prop-types-in-prod\n\t var throwOnDirectAccess = true;\n\t module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n\t} else {\n\t // By explicitly using `prop-types` you are opting into new production behavior.\n\t // http://fb.me/prop-types-in-prod\n\t module.exports = __webpack_require__(21)();\n\t}\n\n\n/***/ }),\n/* 23 */\n/***/ (function(module, exports) {\n\n\t/**\n\t * Copyright (c) 2013-present, Facebook, Inc.\n\t *\n\t * This source code is licensed under the MIT license found in the\n\t * LICENSE file in the root directory of this source tree.\n\t */\n\t\n\t'use strict';\n\t\n\tvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\t\n\tmodule.exports = ReactPropTypesSecret;\n\n\n/***/ })\n/******/ ])\n});\n;\n\n\n// WEBPACK FOOTER //\n// react-cognito.min.js"," \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId])\n \t\t\treturn installedModules[moduleId].exports;\n\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\texports: {},\n \t\t\tid: moduleId,\n \t\t\tloaded: false\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.loaded = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(0);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap f32791e1b57892a236fd","export * from './reducers';\r\nexport * from './actions';\r\nexport * from './states';\r\nexport * from './utils';\r\nexport * from './guard';\r\nexport * from './auth';\r\nexport * from './attributes';\r\nexport * from './policy';\r\n\r\n\r\nexport * from './Login.jsx';\r\nexport * from './Logout.jsx';\r\nexport * from './NewPasswordRequired.jsx';\r\nexport * from './EmailVerification.jsx';\r\nexport * from './PasswordReset.jsx';\r\nexport * from './Confirm.jsx';\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/index.js","/**\r\n * container for all the actions\r\n*/\r\nconst Action = {\r\n\r\n configure: config => ({\r\n type: 'COGNITO_CONFIGURE',\r\n config,\r\n }),\r\n\r\n authenticated: user => ({\r\n type: 'COGNITO_AUTHENTICATED',\r\n user,\r\n }),\r\n\r\n loggingIn: attributes => ({\r\n type: 'COGNITO_LOGGING_IN',\r\n attributes,\r\n }),\r\n\r\n login: (creds, attributes, groups) => ({\r\n type: 'COGNITO_LOGIN',\r\n creds,\r\n groups,\r\n attributes,\r\n }),\r\n\r\n logout: () => ({\r\n type: 'COGNITO_LOGOUT',\r\n }),\r\n\r\n partialLogout: () => ({\r\n type: 'COGNITO_PARTIAL_LOGOUT',\r\n }),\r\n\r\n loginFailure: (user, error) => ({\r\n type: 'COGNITO_LOGIN_FAILURE',\r\n user,\r\n error,\r\n }),\r\n\r\n mfaRequired: user => ({\r\n type: 'COGNITO_LOGIN_MFA_REQUIRED',\r\n user,\r\n }),\r\n\r\n newPasswordRequired: user => ({\r\n type: 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED',\r\n user,\r\n }),\r\n\r\n newPasswordRequiredFailure: (user, error) => ({\r\n type: 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE',\r\n user,\r\n error,\r\n }),\r\n\r\n emailVerificationRequired: attributes => ({\r\n type: 'COGNITO_EMAIL_VERIFICATION_REQUIRED',\r\n attributes,\r\n }),\r\n\r\n emailVerificationFailed: (user, error) => ({\r\n type: 'COGNITO_EMAIL_VERIFICATION_FAILED',\r\n user,\r\n error,\r\n }),\r\n\r\n beginPasswordResetFlow: (user, error) => ({\r\n type: 'COGNITO_BEGIN_PASSWORD_RESET_FLOW',\r\n user,\r\n error,\r\n }),\r\n\r\n continuePasswordResetFlow: user => ({\r\n type: 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW',\r\n user,\r\n }),\r\n\r\n finishPasswordResetFlow: error => ({\r\n type: 'COGNITO_FINISH_PASSWORD_RESET_FLOW',\r\n error,\r\n }),\r\n\r\n updateAttributes: attributes => ({\r\n type: 'COGNITO_UPDATE_USER_ATTRIBUTES',\r\n attributes,\r\n }),\r\n\r\n confirmationRequired: (user, email) => ({\r\n type: 'COGNITO_USER_UNCONFIRMED',\r\n user,\r\n email,\r\n }),\r\n\r\n confirmFailed: (user, error) => ({\r\n type: 'COGNITO_USER_CONFIRM_FAILED',\r\n user,\r\n error,\r\n }),\r\n\r\n clearCache: () => ({\r\n type: 'COGNITO_CLEAR_CACHE',\r\n }),\r\n};\r\n\r\nexport { Action };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/actions.js","module.exports = __WEBPACK_EXTERNAL_MODULE_2__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"React\",\"commonjs2\":\"react\",\"commonjs\":\"react\",\"amd\":\"react\"}\n// module id = 2\n// module chunks = 0","module.exports = __WEBPACK_EXTERNAL_MODULE_3__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"ReactRedux\",\"commonjs\":\"react-redux\",\"commonjs2\":\"react-redux\",\"amd\":\"react-redux\"}\n// module id = 3\n// module chunks = 0","\r\nimport { Action } from './actions';\r\n\r\n/**\r\n * Request that a verification code is sent by email or SMS to verify\r\n * an attribute\r\n * @param {object} user - the cognito user object\r\n * @param {string} attribute - the attribute name\r\n*/\r\nconst sendAttributeVerificationCode = (user, attribute) =>\r\n new Promise((resolve, reject) => {\r\n user.getAttributeVerificationCode(attribute, {\r\n onSuccess: () => resolve(false),\r\n inputVerificationCode: () => resolve(true),\r\n onFailure: error => reject(error.message),\r\n });\r\n });\r\n\r\n/**\r\n * Fetches the user attributes from Cognito, and turns them into\r\n * an object\r\n * @param {object} user - the cognito user object\r\n * @returns {Promise} resolves with the attributes or rejects with an error message\r\n*/\r\nconst getUserAttributes = user =>\r\n new Promise((resolve, reject) =>\r\n user.getUserAttributes((error, result) => {\r\n if (error) {\r\n reject(error.message);\r\n } else {\r\n const attributes = {};\r\n for (let i = 0; i < result.length; i += 1) {\r\n const name = result[i].getName();\r\n const value = result[i].getValue();\r\n attributes[name] = value;\r\n }\r\n resolve(attributes);\r\n }\r\n }),\r\n );\r\n\r\n/**\r\n * convert an attribute dictionary to an attribute list\r\n * @param {object} attributes - a dictionary of attributes\r\n * @return {array} AWS expected attribute list\r\n*/\r\nconst mkAttrList = attributes =>\r\n Object.keys(attributes).map(key => ({\r\n Name: key,\r\n Value: attributes[key],\r\n }));\r\n\r\n/**\r\n * update the attributes in Cognito\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} attributes - an attributes dictionary with the attributes to be updated\r\n * @return {Promise} a promise that resolves to a redux action\r\n*/\r\nconst updateAttributes = (user, attributes) =>\r\n new Promise((resolve, reject) => {\r\n const attributeList = mkAttrList(attributes);\r\n user.updateAttributes(attributeList, (err) => {\r\n if (err) {\r\n reject(err.message);\r\n } else {\r\n resolve(Action.updateAttributes(attributes));\r\n }\r\n });\r\n });\r\n\r\nexport {\r\n sendAttributeVerificationCode,\r\n getUserAttributes,\r\n updateAttributes,\r\n mkAttrList,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/attributes.js","import { CognitoUser, AuthenticationDetails } from 'amazon-cognito-identity-js';\r\nimport { CognitoIdentityCredentials } from 'aws-sdk/global';\r\nimport { Action } from './actions';\r\nimport { getUserAttributes, mkAttrList, sendAttributeVerificationCode } from './attributes';\r\nimport { buildLogins, getGroups } from './utils';\r\n\r\n/**\r\n * sends the email verification code and transitions to the correct state\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} attributes - the attributes dictionary\r\n * @return {Promise} a promise that resolves to a redux action\r\n*/\r\nconst emailVerificationFlow = (user, attributes) =>\r\n new Promise(resolve =>\r\n sendAttributeVerificationCode(user, 'email').then((required) => {\r\n if (required) {\r\n resolve(Action.emailVerificationRequired(attributes));\r\n } else {\r\n // dead end?\r\n resolve(Action.loggingIn(attributes));\r\n }\r\n }, (error) => {\r\n // some odd classes of error here\r\n resolve(Action.emailVerificationFailed(error, attributes));\r\n }));\r\n\r\n/**\r\n * logs in to the federated identity pool with a JWT\r\n * @param {string} username - the username\r\n * @param {string} jwtToken - a token from the session\r\n * @param {object} config - the react-cognito config\r\n * @return {Promise} a promise that resolves to the federated identity credentials\r\n*/\r\nconst refreshIdentityCredentials = (username, jwtToken, config) =>\r\n new Promise((resolve, reject) => {\r\n const logins = buildLogins(username, jwtToken, config);\r\n const creds = new CognitoIdentityCredentials(logins, { region: config.region });\r\n creds.refresh((error) => {\r\n if (error) {\r\n reject(error.message);\r\n } else {\r\n resolve(creds);\r\n }\r\n });\r\n });\r\n\r\n/**\r\n * establishes a session with the user pool, and optionally logs into the federated identity\r\n * pool using a token from the session.\r\n * @param {object} user - the CognitoUser object\r\n * @param {object} config -the react-cognito config\r\n * @return {Promise} an action to be dispatched\r\n*/\r\nconst performLogin = (user, config, group) =>\r\n new Promise((resolve, reject) => {\r\n if (user === null) {\r\n resolve(Action.logout());\r\n } else {\r\n user.getSession((err, session) => {\r\n if (err) {\r\n resolve(Action.loginFailure(user, err.message));\r\n } else {\r\n const jwtToken = session.getIdToken().getJwtToken();\r\n const groups = getGroups(jwtToken);\r\n if (group && !groups.includes(group)) {\r\n return resolve(Action.loginFailure(user, 'Insufficient privilege'));\r\n }\r\n\r\n if (config.identityPool) {\r\n const username = user.getUsername();\r\n refreshIdentityCredentials(username, jwtToken, config).then(\r\n (creds) => {\r\n getUserAttributes(user).then((attributes) => {\r\n resolve(Action.login(creds, attributes, groups));\r\n });\r\n },\r\n message => resolve(Action.loginFailure(user, message)));\r\n } else {\r\n getUserAttributes(user).then((attributes) => {\r\n resolve(Action.login(null, attributes, groups));\r\n });\r\n }\r\n }\r\n });\r\n }\r\n });\r\n\r\n/**\r\n *\r\n * Authenticates with a user pool, and handles responses.\r\n * if the authentication is successful it then logs in to the\r\n * identity pool if provided in config.\r\n *\r\n * returns an action depending on the outcome. Possible actions returned\r\n * are:\r\n *\r\n * - login - valid user who is logged in\r\n * - loginFailure - failed to authenticate with user pool or identity pool\r\n * - mfaRequired - user now needs to enter MFA\r\n * - newPasswordRequired - user must change password on first login\r\n * - emailVerificationRequired - user must verify their email address\r\n * - emailVerificationFailed - email verification is required, but won't work\r\n *\r\n * Dispatch the resulting action, e.g.:\r\n *\r\n * ```\r\n * const { userPool, config } = state.cognito;\r\n * authenticate(username, password, userPool, config).then(dispatch);\r\n * ```\r\n *\r\n * @param {string} username - the username provided by the user\r\n * @param {string} password - the password provided by the user\r\n * @param {object} userPool - a Cognito User Pool object\r\n * @return {Promise} - a promise that resolves an action to be dispatched\r\n *\r\n*/\r\nconst authenticate = (username, password, userPool, config, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const creds = new AuthenticationDetails({\r\n Username: username,\r\n Password: password,\r\n });\r\n\r\n const user = new CognitoUser({\r\n Username: username,\r\n Pool: userPool,\r\n });\r\n\r\n user.authenticateUser(creds, {\r\n onSuccess: () => {\r\n dispatch(Action.authenticated(user));\r\n resolve();\r\n },\r\n onFailure: (error) => {\r\n if (error.code === 'UserNotConfirmedException') {\r\n dispatch(Action.confirmationRequired(user));\r\n resolve();\r\n } else {\r\n dispatch(Action.loginFailure(user, error.message));\r\n reject(error);\r\n }\r\n },\r\n mfaRequired: () => {\r\n dispatch(Action.mfaRequired(user));\r\n resolve();\r\n },\r\n newPasswordRequired: () => {\r\n dispatch(Action.newPasswordRequired(user));\r\n resolve();\r\n },\r\n });\r\n });\r\n\r\n/**\r\n * sign up this user with the user pool provided\r\n * @param {object} userPool - a Cognito userpool (e.g. state.cognito.userPool)\r\n * @param {object} config - the react-cognito config object\r\n * @param {string} username - the username\r\n * @param {string} password - the password\r\n * @param {object} attributes - an attributes dictionary\r\n * @return {Promise} a promise that resolves a redux action\r\n*/\r\nconst registerUser = (userPool, config, username, password, attributes) =>\r\n new Promise((resolve, reject) =>\r\n userPool.signUp(username, password, mkAttrList(attributes), null, (err, result) => {\r\n if (err) {\r\n reject(err.message);\r\n } else if (result.userConfirmed === false) {\r\n resolve(Action.confirmationRequired(result.user, attributes.email));\r\n } else {\r\n resolve(authenticate(username, password, userPool));\r\n }\r\n }));\r\n\r\n\r\nexport {\r\n authenticate,\r\n performLogin,\r\n registerUser,\r\n emailVerificationFlow,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/auth.js","\r\n/** states stored in store.cognito.state */\r\nexport const CognitoState = {\r\n LOGGED_OUT: 'LOGGED_OUT',\r\n AUTHENTICATED: 'AUTHENTICATED',\r\n LOGGING_IN: 'LOGGING_IN',\r\n LOGGED_IN: 'LOGGED_IN',\r\n NEW_PASSWORD_REQUIRED: 'NEW_PASSWORD_REQUIRED',\r\n MFA_REQUIRED: 'MFA_REQUIRED',\r\n EMAIL_VERIFICATION_REQUIRED: 'EMAIL_VERIFICATION_REQUIRED',\r\n CONFIRMATION_REQUIRED: 'CONFIRMATION_REQUIRED',\r\n};\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/states.js","module.exports = __WEBPACK_EXTERNAL_MODULE_7__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external {\"root\":\"AmazonCognitoIdentity\",\"commonjs2\":\"amazon-cognito-identity-js\",\"commonjs\":\"amazon-cognito-identity-js\",\"amd\":\"amazon-cognito-identity-js\"}\n// module id = 7\n// module chunks = 0","import { util as AWSutil } from 'aws-sdk/global';\r\n\r\n/**\r\n * Change a user's password\r\n * @param {object} user - the cognito user object\r\n * @param {string} oldPassword - the current password\r\n * @param {string} newPassword - the new password\r\n*/\r\nconst changePassword = (user, oldPassword, newPassword) =>\r\n new Promise((resolve, reject) =>\r\n user.changePassword(oldPassword, newPassword, (err, result) => {\r\n if (err) {\r\n reject(err.message);\r\n } else {\r\n resolve(result);\r\n }\r\n }));\r\n\r\n/**\r\n * builds the federated identity pool login structure\r\n * @param {string} username - the username of the user\r\n * @param {string} jwtToken - a JWT Token from the session\r\n * @param {object} config - the cognito react config object\r\n*/\r\nconst buildLogins = (username, jwtToken, config) => {\r\n const loginDomain = `cognito-idp.${config.region}.amazonaws.com`;\r\n const loginUrl = `${loginDomain}/${config.userPool}`;\r\n const creds = {\r\n IdentityPoolId: config.identityPool,\r\n Logins: {},\r\n LoginId: username, // https://github.com/aws/aws-sdk-js/issues/609\r\n };\r\n creds.Logins[loginUrl] = jwtToken;\r\n return creds;\r\n};\r\n\r\n/**\r\n * Decode a jwtToken to check for cognito:groups\r\n * @param {string} jwtToken - a JWT Token from the session\r\n */\r\nconst getGroups = (jwtToken) => {\r\n const payload = jwtToken.split('.')[1];\r\n const decodedToken = JSON.parse(AWSutil.base64.decode(payload).toString('utf8'));\r\n // decodedToken['cognito:groups'] can be undefined if user is in no groups\r\n if (!decodedToken['cognito:groups']) {\r\n return [];\r\n }\r\n return decodedToken['cognito:groups'];\r\n};\r\n\r\nexport {\r\n changePassword,\r\n buildLogins,\r\n getGroups,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/utils.js","module.exports = __WEBPACK_EXTERNAL_MODULE_9__;\n\n\n//////////////////\n// WEBPACK FOOTER\n// external \"aws-sdk/global\"\n// module id = 9\n// module chunks = 0","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseConfirm = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n onResend: props.onResend,\r\n onCancel: props.onCancel,\r\n });\r\n\r\nconst confirm = (verificationCode, user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.confirmRegistration(verificationCode, true, (error) => {\r\n if (error) {\r\n dispatch(Action.confirmFailed(user));\r\n reject(error.message);\r\n } else {\r\n dispatch(Action.partialLogout());\r\n resolve(user);\r\n }\r\n });\r\n });\r\n\r\nconst resend = (user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.resendConfirmationCode((err) => {\r\n if (err) {\r\n dispatch(Action.confirmationRequired(user));\r\n reject(err.message);\r\n } else {\r\n dispatch(Action.confirmationRequired(user));\r\n resolve(user);\r\n }\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n confirmPartial: (verificationCode, user) =>\r\n confirm(verificationCode, user, dispatch),\r\n onCancel: () => dispatch(Action.logout()),\r\n onResendPartial: user => resend(user, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, dispatchProps, {\r\n onSubmit: verificationCode =>\r\n dispatchProps.confirmPartial(verificationCode, stateProps.user),\r\n onResend: () =>\r\n dispatchProps.onResendPartial(stateProps.user),\r\n });\r\n\r\n/**\r\n * Container for a confirmation form. Magically adds the following props to the \r\n * contained form:\r\n *\r\n * * user - the Cognito User from the redux store\r\n * * error - the persisted error from the redux store\r\n * * onSubmit - a handler that calls the Cognito confirm API\r\n * * onResend - a handler that calls the Cognito resend request API\r\n * * onCancel - Logs the user out completely\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n *\r\n */\r\nexport const Confirm = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseConfirm);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Confirm.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseEmailVerification = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n onCancel: props.onCancel,\r\n });\r\n\r\nexport const verifyEmail = (verificationCode, user, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.verifyAttribute('email', verificationCode, {\r\n onSuccess: () => {\r\n dispatch(Action.login(user));\r\n resolve();\r\n },\r\n inputVerificationCode: () => {\r\n dispatch(Action.emailVerificationRequired(user));\r\n reject();\r\n },\r\n onFailure: (error) => {\r\n dispatch(Action.emailVerificationFailed(user, error.message));\r\n reject();\r\n },\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n verifyPartial: (verificationCode, user) =>\r\n verifyEmail(verificationCode, user, dispatch),\r\n onCancel: () => dispatch(Action.logout()),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, dispatchProps, {\r\n onSubmit: verificationCode =>\r\n dispatchProps.verifyPartial(verificationCode, stateProps.user),\r\n });\r\n\r\n/**\r\n * Wrapper for an Email Verification Form.\r\n * Magically adds the following props to the contained form:\r\n *\r\n * * user - the Cognito user from the Redux store\r\n * * error - the persisted error from the Redux store\r\n * * onSubmit - a handler that calls the Cognito verification API\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n *\r\n */\r\nexport const EmailVerification = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseEmailVerification);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/EmailVerification.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { authenticate } from './auth';\r\nimport { Action } from './actions';\r\n\r\nconst BaseLogin = props =>\r\n React.cloneElement(props.children, {\r\n username: props.username,\r\n email: props.email,\r\n onSubmit: props.onSubmit,\r\n clearCache: props.clearCache,\r\n error: props.error,\r\n });\r\n\r\nconst mapStateToProps = (state) => {\r\n let username = '';\r\n if (state.cognito.user) {\r\n username = state.cognito.user.getUsername();\r\n } else if (state.cognito.userName) {\r\n username = state.cognito.cache.userName;\r\n }\r\n return {\r\n username,\r\n email: state.cognito.cache.email,\r\n config: state.cognito.config,\r\n userPool: state.cognito.userPool,\r\n error: state.cognito.error,\r\n };\r\n};\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n authenticator: (username, password, userPool, config) =>\r\n authenticate(username, password, userPool, config, dispatch),\r\n clearCache: () => dispatch(Action.clearCache()),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n onSubmit: (username, password) =>\r\n dispatchProps.authenticator(username, password, stateProps.userPool, stateProps.config),\r\n clearCache: dispatchProps.clearCache,\r\n });\r\n\r\n/**\r\n * Container for login behaviour, wrapping a login form.\r\n *\r\n * Magically provides the following props to the wrapped form:\r\n *\r\n * * username\r\n * * onSubmit\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nconst Login = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseLogin);\r\n\r\nexport { Login };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Login.jsx","import React from 'react';\r\nimport PropTypes from 'prop-types'\r\nimport { Action } from './actions';\r\n\r\n/**\r\n * Container for logout behaviour.\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nexport class Logout extends React.Component {\r\n\r\n /**\r\n * Passed to child element as onClick prop.\r\n * Signs the user out, and then dispatches the logout action\r\n * If you want to take further actions (like reloading UI) then add an\r\n * onLogout property to the Logout element\r\n */\r\n onClick = (event) => {\r\n const { store } = this.context;\r\n const state = store.getState();\r\n state.cognito.user.signOut();\r\n event.preventDefault();\r\n store.dispatch(Action.logout());\r\n this.props.onLogout();\r\n }\r\n\r\n /**\r\n * renders the child element, adding an onClick property\r\n */\r\n render() {\r\n return React.cloneElement(this.props.children, {\r\n onClick: this.onClick,\r\n });\r\n }\r\n}\r\nLogout.contextTypes = {\r\n store: PropTypes.object,\r\n};\r\nLogout.propTypes = {\r\n children: PropTypes.any.isRequired,\r\n onLogout: PropTypes.func,\r\n};\r\nLogout.defaultProps = {\r\n onLogout: () => {},\r\n};\r\n\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/Logout.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { Action } from './actions';\r\n\r\nconst BaseNewPasswordRequired = props =>\r\n React.cloneElement(props.children, {\r\n error: props.error,\r\n onSubmit: props.onSubmit,\r\n });\r\n\r\nconst setNewPassword = (password, user, config, userAttributes, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n user.completeNewPasswordChallenge(password, userAttributes, {\r\n onSuccess: () => {\r\n dispatch(Action.authenticated(user));\r\n resolve();\r\n },\r\n onFailure: error => {\r\n dispatch(Action.newPasswordRequiredFailure(user, error.message));\r\n reject(error);\r\n },\r\n mfaRequired: () => {\r\n dispatch(Action.mfaRequired(user));\r\n resolve();\r\n },\r\n newPasswordRequired: () => {\r\n dispatch(Action.newPasswordRequired(user));\r\n resolve();\r\n },\r\n });\r\n });\r\n\r\nconst mapStateToProps = state => ({\r\n error: state.cognito.error,\r\n user: state.cognito.user,\r\n config: state.cognito.config,\r\n});\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n setNewPasswordPartial: (password, user, config, userAttributes) =>\r\n setNewPassword(password, user, config, userAttributes, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n onSubmit: (password, userAttributes) =>\r\n dispatchProps.setNewPasswordPartial(\r\n password,\r\n stateProps.user,\r\n stateProps.config,\r\n userAttributes),\r\n });\r\n\r\n/**\r\n * Wrapper for a New Password Required form\r\n *\r\n * Magically provides the following props to the wrapped element:\r\n *\r\n * * user - the Cognito user\r\n * * error - the persistent react-cognito error message\r\n * * onSubmit - a handler that calls the Set New Password API\r\n *\r\n * @example\r\n *\r\n * \r\n * \r\n * \r\n */\r\nexport const NewPasswordRequired = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BaseNewPasswordRequired);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/NewPasswordRequired.jsx","import React from 'react';\r\nimport { connect } from 'react-redux';\r\nimport { CognitoUser } from 'amazon-cognito-identity-js';\r\nimport { Action } from './actions';\r\n\r\nconst BasePasswordReset = props =>\r\n React.cloneElement(props.children, {\r\n username: props.username,\r\n sendVerificationCode: props.sendVerificationCode,\r\n setPassword: props.setPassword,\r\n });\r\n\r\nconst getUser = (username, userPool) => {\r\n const user = new CognitoUser({\r\n Username: username,\r\n Pool: userPool,\r\n });\r\n return user;\r\n};\r\n\r\nconst setPassword = (username, userPool, code, password, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const user = getUser(username, userPool);\r\n user.confirmPassword(code, password, {\r\n onSuccess: () => {\r\n dispatch(Action.finishPasswordResetFlow()),\r\n resolve();\r\n },\r\n onFailure: err => {\r\n dispatch(Action.beginPasswordResetFlow(user, err.message)),\r\n reject(err);\r\n }\r\n });\r\n });\r\n\r\n\r\nconst sendVerificationCode = (username, userPool, dispatch) =>\r\n new Promise((resolve, reject) => {\r\n const user = getUser(username, userPool);\r\n user.forgotPassword({\r\n onSuccess: () => {\r\n dispatch(Action.continuePasswordResetFlow(user));\r\n resolve();\r\n },\r\n onFailure: err => {\r\n dispatch(Action.beginPasswordResetFlow(user, err.message));\r\n reject(err);\r\n }\r\n });\r\n });\r\n\r\n\r\nconst mapStateToProps = (state) => {\r\n const props = {\r\n user: state.cognito.user,\r\n username: '',\r\n userPool: state.cognito.userPool,\r\n };\r\n if (state.cognito.user != null) {\r\n props.username = state.cognito.user.getUsername();\r\n }\r\n return props;\r\n};\r\n\r\nconst mapDispatchToProps = dispatch => ({\r\n sendVerificationCodePartial: (username, userPool) =>\r\n sendVerificationCode(username, userPool, dispatch),\r\n setPasswordPartial: (user, userPool, code, password) =>\r\n setPassword(user, userPool, code, password, dispatch),\r\n});\r\n\r\nconst mergeProps = (stateProps, dispatchProps, ownProps) =>\r\n Object.assign({}, ownProps, stateProps, {\r\n sendVerificationCode: username =>\r\n dispatchProps.sendVerificationCodePartial(username, stateProps.userPool),\r\n setPassword: (username, code, password) =>\r\n dispatchProps.setPasswordPartial(username, stateProps.userPool, code, password),\r\n });\r\n\r\n/**\r\n * Container for a Password Reset form\r\n *\r\n * Magically provides the following props to the wrapped element:\r\n *\r\n * * user\r\n * * username\r\n * * sendVerificationCode\r\n * * setPassword\r\n *\r\n * @example\r\n * \r\n * \r\n * \r\n */\r\nexport const PasswordReset = connect(\r\n mapStateToProps,\r\n mapDispatchToProps,\r\n mergeProps,\r\n)(BasePasswordReset);\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/PasswordReset.jsx","\r\n/*\r\n Default behaviour is to restrict access to only logged in users\r\n*/\r\n\r\nconst testLoggedIn = (state, wantLoggedIn) => {\r\n const isLoggedIn = state.cognito.user !== null;\r\n if (isLoggedIn && wantLoggedIn) {\r\n return true;\r\n }\r\n if (!isLoggedIn && !wantLoggedIn) {\r\n return true;\r\n }\r\n return false;\r\n};\r\n\r\nconst permitted = (state, expr) =>\r\n new Promise((resolve) => {\r\n if (expr.loggedIn !== undefined) {\r\n resolve(testLoggedIn(state, expr.loggedIn));\r\n } else {\r\n resolve(testLoggedIn(state, true));\r\n }\r\n });\r\n\r\nconst guard = (store, forbiddenUrl, expr = {}, routeState, replace, callback) => {\r\n const state = store.getState();\r\n let dest = forbiddenUrl;\r\n\r\n if (expr.forbiddenUrl !== undefined) {\r\n dest = expr.forbiddenUrl;\r\n }\r\n permitted(state, expr).then((allow) => {\r\n if (!allow) {\r\n replace(dest);\r\n }\r\n callback();\r\n });\r\n};\r\n\r\n/**\r\n * creates a guard function you can use in tags\r\n * @param {object} store - the redux store\r\n * @param {string} forbiddenUrl - the default url to navigate to if forbidden\r\n * @returns {function} - a function that can be provided to onEnter\r\n*/\r\nconst createGuard = (store, forbiddenUrl) => expr => (state, replace, callback) =>\r\n guard(store, forbiddenUrl, expr, state, replace, callback);\r\n\r\n\r\nexport { createGuard };\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/guard.js","import { Action } from './actions';\r\nimport { getUserAttributes } from './attributes';\r\nimport { emailVerificationFlow, performLogin } from './auth';\r\nimport { CognitoState } from './states';\r\n\r\n/**\r\n * subscribes a \"policy\" function to the store, and calls it\r\n * with the state and the dispatch function\r\n * @param {object} store - the redux store\r\n * @param {function} f - f(state, dispatch)\r\n*/\r\nconst enable = (store, f, params) => {\r\n store.subscribe(() => {\r\n const state = store.getState();\r\n const dispatch = store.dispatch;\r\n f(state, dispatch, params);\r\n });\r\n};\r\n\r\n/**\r\n * requires email verification before transitioning from AUTHENTICATED\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst emailVerificationRequired = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n const user = state.cognito.user;\r\n getUserAttributes(user).then((attributes) => {\r\n if (attributes.email_verified !== 'true') {\r\n emailVerificationFlow(user, attributes).then(dispatch);\r\n } else {\r\n dispatch(Action.loggingIn(attributes));\r\n }\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * fetches and stores attributes before transitioning from AUTHENTICATED\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst fetchAttributes = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n const user = state.cognito.user;\r\n getUserAttributes(user).then((attributes) => {\r\n dispatch(Action.loggingIn(attributes));\r\n });\r\n }\r\n};\r\n\r\n/**\r\n * transitions directly from AUTHENTICATED to LOGGING_IN\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst direct = (state, dispatch) => {\r\n if (state.cognito.state === CognitoState.AUTHENTICATED) {\r\n dispatch(Action.loggingIn());\r\n }\r\n};\r\n\r\n/**\r\n * logs into the single federated identity pool to transition from LOGGING_IN\r\n * to LOGGED_IN\r\n * @param {object} state - the redux store state\r\n * @param {function} dispatch - the dispatch function\r\n*/\r\nconst identityPoolLogin = (state, dispatch, group) => {\r\n if (state.cognito.state === CognitoState.LOGGING_IN) {\r\n performLogin(state.cognito.user, state.cognito.config, group).then(dispatch);\r\n }\r\n};\r\n\r\n/**\r\n * sets up react-cognito with default policies.\r\n*/\r\nconst setupCognito = (store, config, listeners =\r\n [emailVerificationRequired, identityPoolLogin]) => {\r\n store.dispatch(Action.configure(config));\r\n listeners.forEach((f) => {\r\n enable(store, f, config.group);\r\n });\r\n store.dispatch(Action.loggingIn({}));\r\n};\r\n\r\nexport {\r\n setupCognito,\r\n enable,\r\n direct,\r\n fetchAttributes,\r\n emailVerificationRequired,\r\n identityPoolLogin,\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/policy.js","import { CognitoUserPool } from 'amazon-cognito-identity-js';\r\nimport { CognitoState } from './states';\r\n\r\n/* global AWS */\r\n\r\nconst initial = {\r\n user: null,\r\n cache: { // cached for post register login\r\n userName: null,\r\n email: null,\r\n },\r\n state: CognitoState.LOGGED_OUT,\r\n error: '',\r\n userPool: null,\r\n attributes: {},\r\n creds: null,\r\n groups: [],\r\n config: {\r\n region: null,\r\n userPool: null,\r\n clientId: null,\r\n identityPool: null,\r\n },\r\n};\r\n\r\nconst configure = (state, action) => {\r\n // surprise side-effect!\r\n AWS.config.region = action.config.region;\r\n const pool = new CognitoUserPool({\r\n UserPoolId: action.config.userPool,\r\n ClientId: action.config.clientId,\r\n });\r\n const user = pool.getCurrentUser();\r\n return Object.assign({}, state, {\r\n config: action.config,\r\n userPool: pool,\r\n user,\r\n });\r\n};\r\n\r\n// sometimes we don't get the attributes in later parts of the login flow\r\n// but lets not clobber the ones we've got if we've not got them\r\nconst addAttributes = (s, attributes) => {\r\n const s2 = Object.assign({}, s);\r\n if (attributes) {\r\n s2.attributes = attributes;\r\n }\r\n return s2;\r\n};\r\n\r\n/**\r\n * reducer function to be passed to redux combineReducers\r\n * @param {object} state\r\n * @param {object} action\r\n*/\r\n\r\nexport const cognito = (state = initial, action) => {\r\n switch (action.type) {\r\n\r\n case 'COGNITO_CONFIGURE':\r\n return configure(state, action);\r\n\r\n case 'COGNITO_AUTHENTICATED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n cache: {\r\n userName: null,\r\n email: null,\r\n },\r\n error: '',\r\n state: CognitoState.AUTHENTICATED,\r\n });\r\n\r\n case 'COGNITO_CLEAR_CACHE':\r\n return Object.assign({}, state, {\r\n cache: {\r\n userName: null,\r\n email: null,\r\n },\r\n });\r\n\r\n case 'COGNITO_LOGGING_IN':\r\n return Object.assign({}, state, {\r\n state: CognitoState.LOGGING_IN,\r\n attributes: action.attributes,\r\n });\r\n\r\n case 'COGNITO_LOGIN':\r\n return Object.assign({}, state, addAttributes({\r\n error: '',\r\n creds: action.creds,\r\n groups: action.groups,\r\n state: CognitoState.LOGGED_IN,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_LOGOUT':\r\n return Object.assign({}, state, {\r\n user: null,\r\n attributes: {},\r\n error: '',\r\n creds: null,\r\n groups: [],\r\n state: CognitoState.LOGGED_OUT,\r\n });\r\n\r\n case 'COGNITO_PARTIAL_LOGOUT':\r\n return Object.assign({}, state, {\r\n user: null,\r\n userName: state.user.username,\r\n error: '',\r\n creds: null,\r\n groups: [],\r\n state: CognitoState.LOGGED_OUT,\r\n });\r\n\r\n case 'COGNITO_LOGIN_FAILURE':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.LOGGED_OUT,\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_LOGIN_MFA_REQUIRED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n error: '',\r\n state: CognitoState.MFA_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_LOGIN_NEW_PASSWORD_REQUIRED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n error: '',\r\n state: CognitoState.NEW_PASSWORD_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_USER_UNCONFIRMED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.CONFIRMATION_REQUIRED,\r\n cache: {\r\n userName: action.user.username,\r\n email: action.email ? action.email : state.cache.email,\r\n },\r\n });\r\n\r\n case 'COGNITO_USER_CONFIRM_FAILED':\r\n return Object.assign({}, state, {\r\n user: action.user,\r\n state: CognitoState.CONFIRMATION_REQUIRED,\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_NEW_PASSWORD_REQUIRED_FAILURE':\r\n return Object.assign({}, state, {\r\n error: action.error,\r\n state: CognitoState.NEW_PASSWORD_REQUIRED,\r\n });\r\n\r\n case 'COGNITO_EMAIL_VERIFICATION_REQUIRED':\r\n return Object.assign({}, state, addAttributes({\r\n error: '',\r\n state: CognitoState.EMAIL_VERIFICATION_REQUIRED,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_EMAIL_VERIFICATION_FAILED':\r\n return Object.assign({}, state, addAttributes({\r\n error: action.error,\r\n state: CognitoState.EMAIL_VERIFICATION_REQUIRED,\r\n }, action.attributes));\r\n\r\n case 'COGNITO_BEGIN_PASSWORD_RESET_FLOW':\r\n return Object.assign({}, state, {\r\n error: action.error,\r\n });\r\n\r\n case 'COGNITO_CONTINUE_PASSWORD_RESET_FLOW':\r\n return state;\r\n\r\n case 'COGNITO_FINISH_PASSWORD_RESET_FLOW':\r\n return state;\r\n\r\n // this moves us into the AUTHENTICATED state, potentially causing\r\n // a number of side-effects. this is so we can re-verify the email\r\n // address if we have to\r\n case 'COGNITO_UPDATE_USER_ATTRIBUTES':\r\n return Object.assign({}, state, {\r\n attributes: Object.assign({}, state.attributes, action.attributes),\r\n state: CognitoState.AUTHENTICATED,\r\n });\r\n\r\n default:\r\n return state;\r\n }\r\n};\r\n\n\n\n// WEBPACK FOOTER //\n// ./src/reducers.js","\"use strict\";\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * \n */\n\nfunction makeEmptyFunction(arg) {\n return function () {\n return arg;\n };\n}\n\n/**\n * This function accepts and discards inputs; it has no side effects. This is\n * primarily useful idiomatically for overridable function endpoints which\n * always need to be callable, since JS lacks a null-call idiom ala Cocoa.\n */\nvar emptyFunction = function emptyFunction() {};\n\nemptyFunction.thatReturns = makeEmptyFunction;\nemptyFunction.thatReturnsFalse = makeEmptyFunction(false);\nemptyFunction.thatReturnsTrue = makeEmptyFunction(true);\nemptyFunction.thatReturnsNull = makeEmptyFunction(null);\nemptyFunction.thatReturnsThis = function () {\n return this;\n};\nemptyFunction.thatReturnsArgument = function (arg) {\n return arg;\n};\n\nmodule.exports = emptyFunction;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/emptyFunction.js\n// module id = 19\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/fbjs/lib/invariant.js\n// module id = 20\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar invariant = require('fbjs/lib/invariant');\nvar ReactPropTypesSecret = require('./lib/ReactPropTypesSecret');\n\nmodule.exports = function() {\n function shim(props, propName, componentName, location, propFullName, secret) {\n if (secret === ReactPropTypesSecret) {\n // It is still safe when called from React.\n return;\n }\n invariant(\n false,\n 'Calling PropTypes validators directly is not supported by the `prop-types` package. ' +\n 'Use PropTypes.checkPropTypes() to call them. ' +\n 'Read more at http://fb.me/use-check-prop-types'\n );\n };\n shim.isRequired = shim;\n function getShim() {\n return shim;\n };\n // Important!\n // Keep this list in sync with production version in `./factoryWithTypeCheckers.js`.\n var ReactPropTypes = {\n array: shim,\n bool: shim,\n func: shim,\n number: shim,\n object: shim,\n string: shim,\n symbol: shim,\n\n any: shim,\n arrayOf: getShim,\n element: shim,\n instanceOf: getShim,\n node: shim,\n objectOf: getShim,\n oneOf: getShim,\n oneOfType: getShim,\n shape: getShim,\n exact: getShim\n };\n\n ReactPropTypes.checkPropTypes = emptyFunction;\n ReactPropTypes.PropTypes = ReactPropTypes;\n\n return ReactPropTypes;\n};\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/factoryWithThrowingShims.js\n// module id = 21\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nif (process.env.NODE_ENV !== 'production') {\n var REACT_ELEMENT_TYPE = (typeof Symbol === 'function' &&\n Symbol.for &&\n Symbol.for('react.element')) ||\n 0xeac7;\n\n var isValidElement = function(object) {\n return typeof object === 'object' &&\n object !== null &&\n object.$$typeof === REACT_ELEMENT_TYPE;\n };\n\n // By explicitly using `prop-types` you are opting into new development behavior.\n // http://fb.me/prop-types-in-prod\n var throwOnDirectAccess = true;\n module.exports = require('./factoryWithTypeCheckers')(isValidElement, throwOnDirectAccess);\n} else {\n // By explicitly using `prop-types` you are opting into new production behavior.\n // http://fb.me/prop-types-in-prod\n module.exports = require('./factoryWithThrowingShims')();\n}\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/index.js\n// module id = 22\n// module chunks = 0","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\nvar ReactPropTypesSecret = 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED';\n\nmodule.exports = ReactPropTypesSecret;\n\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./~/prop-types/lib/ReactPropTypesSecret.js\n// module id = 23\n// module chunks = 0"],"sourceRoot":""} \ No newline at end of file