new Factory(function (buildObject) { this.input = { ...buildObject }; }) .attr('name', () => faker.name.findName()) .attr('email', () => faker.internet.email())
this.props.session.gatewayClient .forgotPassword(this.state.email) .then(() => this.setState({ success: true, forgotInProgress: false })) .catch(e => { console.log(e); this.setState({ success: true, forgotInProgress: false }); });
componentWillReceiveProps(nextProps) { this.setState({ username: nextProps.username, email: nextProps.email, password: nextProps.password }); }
/* * Return user data */ const getUserData = (data = {}) => ({ id: data.instance, name: data.name || data.instance, email: data.email || 'unknown', })
handleSubmit(event) { event.preventDefault(); event.stopPropagation(); Actions.forgot({ email: this.input.email.value() }); }
oldestOwners.map(async owner => { if (!owner || !owner.userId || !owner.communityId) return; return await r .table('communities') .get(owner.communityId) .update({ administratorEmail: owner.email, creatorId: owner.userId, }) .run(conn); })
// Helper to get tokens const getTokens = (home, tokens = []) => _(utils.sortTokens(utils.getTerminusTokens(home), tokens)) .map(token => ({name: token.email, value: token.token})) .thru(tokens => tokens.concat([{name: 'add or refresh a token', value: 'more'}])) .value()
this.props.session.gatewayClient.inviteUser(this.state.email, this.state.role).then(invitedUser => { let newState = update(this.state, { users: { $push: [invitedUser] } }); this.setState(newState); });
async function createUser (profile) { debug('CREATE_USER', profile) try { // Create user account const user = new User(profile.name, profile.email, profile.image, profile.emailVerified) return await manager.save(user) } catch (error) { logger.error('CREATE_USER_ERROR', error) return Promise.reject(new CreateUserError(error)) } }
/** * @api {post} /api/v1/gateway/login * @apiName Login * @apiGroup Gateway */ async function login(req, res) { const loginResult = await gladys.gateway.login(req.body.email, req.body.password); res.json(loginResult); }
handleSubmit(event) { event.preventDefault(); event.stopPropagation(); const id = this.props._id; const data = { isActive: this.state.isActive, username: this.state.username, email: this.state.email }; Actions.saveDetails(id, data); }
// Within the context of `Elements`, this call to createToken knows which Element to // tokenize, since there's only one in this group. this.props.stripe .createToken({ email: this.props.email }) .then(({ token }) => { this.props.subscribeToPlan(token); }) .catch(() => { this.props.updateRequestPending(false); });
this.props.session.gatewayClient .forgotPassword(this.state.email) .then(() => this.setState({ success: true, forgotInProgress: false })) .catch(e => { console.log(e); this.setState({ success: true, forgotInProgress: false }); });
/* * Return user data */ const getUserData = (data = {}) => ({ id: data.instance, name: data.name || data.instance, email: data.email || 'unknown', })
// Within the context of `Elements`, this call to createToken knows which Element to // tokenize, since there's only one in this group. this.props.stripe .createToken({ email: this.props.email }) .then(({ token }) => { this.props.subscribeToPlan(token); }) .catch(() => { this.props.updateRequestPending(false); });