Fix a regression in OIDC handling.
This commit is contained in:
@ -452,11 +452,15 @@ export class LivechatProsodyAuth {
|
||||
|
||||
const encryptedArray = data.split(':')
|
||||
const iv = Buffer.from(encryptedArray[0], outputEncoding)
|
||||
const encrypted = Buffer.from(encryptedArray[1], outputEncoding)
|
||||
const encrypted = encryptedArray[1]
|
||||
const decipher = createDecipheriv(algorithm, this._secretKey, iv)
|
||||
|
||||
// FIXME: dismiss the "as any" below (dont understand why Typescript is not happy without)
|
||||
return decipher.update(encrypted.toString(), outputEncoding, inputEncoding) + decipher.final(inputEncoding)
|
||||
return decipher.update(
|
||||
encrypted,
|
||||
// here we must revert outputEncoding and inputEncoding, as were are decrypting.
|
||||
outputEncoding,
|
||||
inputEncoding
|
||||
) + decipher.final(inputEncoding)
|
||||
}
|
||||
|
||||
public static singleton (): LivechatProsodyAuth {
|
||||
|
Reference in New Issue
Block a user