Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
params.username = username;
}
// Email
if (user.emails && user.emails[0].address !== email) {
params.email = email;
}
// newPassword
if (newPassword) {
params.newPassword = newPassword;
}
// currentPassword
if (currentPassword) {
params.currentPassword = SHA256(currentPassword);
}
const requirePassword = !!params.email || newPassword;
if (requirePassword && !params.currentPassword) {
return this.setState({ showPasswordAlert: true, saving: false });
}
try {
if (avatar.url) {
try {
await RocketChat.setAvatarFromService(avatar);
} catch (e) {
this.setState({ saving: false, currentPassword: null });
return this.handleError(e, 'setAvatarFromService', 'changing_avatar');
}
}
login() {
this.$resources.login.save({
account: this.account,
password: sha256(this.password),
}).then((resp) => {
simpleStorage.set('token<%= modulenameUpper %>', resp.body.token);
simpleStorage.set('id<%= modulenameUpper %>', resp.body.id);
const beforeLoginIntention = simpleStorage.get('beforeLoginIntention') || null;
if (beforeLoginIntention) {
simpleStorage.deleteKey('beforeLoginIntention');
location.href = beforeLoginIntention;
} else {
this.$router.push('/home');
}
});
},
},
const getHashChunks = (address) => {
const addressHash = new BigNumber(`0x${sha256(address)}`).toString().substr(3);
return addressHash.match(/\d{5}/g);
};
render() {
let {account} = this.props;
let {height, width} = this.props.size;
let hash = account ? sha256(account) : null;
return (
<canvas data-jdenticon-hash="{hash}" height="{height" width="{width" style="{{height:" id="{this.canvas_id}">
);
}
</canvas>
render() {
let {account} = this.props;
let {height, width} = this.props.size;
let hash = account ? sha256(account) : null;
return (
<canvas data-jdenticon-hash="{hash}" height="{height" width="{width" style="{{height:" id="{this.canvas_id}">
);
}
</canvas>
fr.onload = ({ target }) => resolve(sha256(target?.result));
fr.onerror = err => {
hash: function () {
return this.account ? sha256(this.account) : '';
}
},