async getToken() { if (this.authToken && this.authToken.expires > new Date().getTime()) { return `_dremio${this.authToken.token}`; } const { data } = await axios.post(`${this.config.url}/apiv2/login`, { userName: this.config.user, password: this.config.password }); this.authToken = data; return `_dremio${this.authToken.token}`; }
async containerLazyInit() { return new GenericContainer('mcr.microsoft.com/mssql/server', '2017-latest') .withEnv('ACCEPT_EULA', 'Y') .withEnv('SA_PASSWORD', this.password()) .withExposedPorts(this.port()) .withWaitStrategy(Wait.forLogMessage('Server is listening on')) .start(); }
AuthActions.authenticate({ username: submission.formData.username, password: submission.formData.password, }) .then(() => { this.setState({isSubmitting: false}, () => history.replace('overview')); }) .catch(() => { this.setState({isSubmitting: false}, () => history.replace('login')); });
/** * @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(); Actions.login({ username: this.input.username.value(), password: this.input.password.value() }); }
/** * Promise to add a/an user. * @return {Promise} */ async add(values) { if (values.password) { values.password = await strapi.plugins['users-permissions'].services.user.hashPassword( values ); } return strapi.query('user', 'users-permissions').create(values); }
it('cloud function should obfuscate password', done => { Parse.Cloud.define('testFunction', () => { return 'verify code success'; }); Parse.Cloud.run('testFunction', { username: 'hawk', password: '123456' }) .then(() => { const entry = spy.calls.mostRecent().args; expect(entry[2].params.password).toMatch(/\*\*\*\*\*\*\*\*/); done(); }) .then(null, e => done.fail(e)); });
this.config.database.find('_User', { objectId: this.objectId() }).then(results => { if (results.length != 1) { throw undefined; } if (this.data.password.indexOf(results[0].username) >= 0) return Promise.reject(new Parse.Error(Parse.Error.VALIDATION_ERROR, containsUsernameError)); return Promise.resolve(); })
this.props.signin(this.state.username, this.state.password, { ...this.updateCallbacks, onNewPasswordRequested: (callback) => { this.setState({ isUpdating: false, message: '', password: '', dialogType: dialogType.setNewPassword, newPasswordCallback: callback }) } })
/** * @api {post} /api/v1/reset_password resetPassword * @apiName resetPassword * @apiGroup User * */ async function resetPassword(req, res) { const user = await gladys.user.updatePassword(req.user.id, req.body.password); await gladys.session.revoke(req.user.id, req.session_id); res.json(user); }
handleSubmit(event) { event.preventDefault(); event.stopPropagation(); Actions.savePassword({ password: this.state.password, passwordConfirm: this.state.passwordConfirm }); }
this.props.setCodeAndPassword(this.state.code, this.state.username, this.state.password, { ...this.updateCallbacks, onSuccess: () => { this.setState({ isUpdating: false, message: 'Set new password successfully!', dialogType: dialogType.signin, password: '' }) } })
this.props.setCodeAndPassword(this.state.code, this.state.username, this.state.password, { ...this.updateCallbacks, onSuccess: () => { this.setState({ isUpdating: false, message: 'Set new password successfully!', dialogType: dialogType.signin, password: '' }) } })