mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-25 17:22:55 +00:00
refactor: improve encryption process for login form data
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled
Some checks failed
sync2gitee / repo-sync (push) Has been cancelled
This commit is contained in:
parent
0960d19e25
commit
435491d9e6
|
|
@ -286,7 +286,9 @@ const login = () => {
|
|||
.finally(() => (loading.value = false))
|
||||
} else {
|
||||
const publicKey = forge.pki.publicKeyFromPem(user.rasKey)
|
||||
const encrypted = publicKey.encrypt(JSON.stringify(loginForm.value), 'RSAES-PKCS1-V1_5')
|
||||
const jsonData = JSON.stringify(loginForm.value)
|
||||
const utf8Bytes = forge.util.encodeUtf8(jsonData)
|
||||
const encrypted = publicKey.encrypt(utf8Bytes, 'RSAES-PKCS1-V1_5')
|
||||
const encryptedBase64 = forge.util.encode64(encrypted)
|
||||
user
|
||||
.login({ encryptedData: encryptedBase64, username: loginForm.value.username })
|
||||
|
|
|
|||
Loading…
Reference in New Issue