Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
this.$refs.loginForm.validate((valid) => {
if (valid) {
this.disabled = true
let params = {}
if (this.publicKeyData) {
const encryptor = new Jsencrypt()
encryptor.setPublicKey(this.publicKeyData)
const password = encryptor.encrypt(this.loginForm.password)
params = {
username: this.loginForm.username,
password: password
}
} else {
params = {
username: this.loginForm.username,
password: this.loginForm.password
}
}
this.FesApi.fetch(`/cc/${this.FesEnv.ccApiVersion}/LDAPlogin`, params, 'post').then((res) => {
this.disabled = false
localStorage.setItem('userId', res.userName)
res.isSuperadmin && localStorage.setItem('superAdmin', res.isSuperadmin)