Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
generateKey(){
if(!this.user.passwordHash) {
if(this.password !== "" && this.password === this.password_verif){
this.set('passwordError', '');
var hash = sha256.create()
hash.update(this.password)
const passwordHash = hash.hex()
this.user.passwordHash = passwordHash
}else if(this.password !== this.password_verif){
this.set('passwordError', 'Les mots de passe ne correspondent pas')
return
}else if(this.password === ""){
this.set('passwordError', 'Mot de passe invalide')
return
}