mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Check length
Signed-off-by: Sebastian Malton <sebastian@malton.name>
This commit is contained in:
parent
e92304b92e
commit
2cd28723c0
@ -65,7 +65,7 @@ export class ShellRequestAuthenticator extends Singleton {
|
|||||||
const authToken = clusterTokens.get(tabId);
|
const authToken = clusterTokens.get(tabId);
|
||||||
const buf = Uint8Array.from(Buffer.from(token, "base64"));
|
const buf = Uint8Array.from(Buffer.from(token, "base64"));
|
||||||
|
|
||||||
if (authToken instanceof Uint8Array && crypto.timingSafeEqual(authToken, buf)) {
|
if (authToken instanceof Uint8Array && authToken.length === buf.length && crypto.timingSafeEqual(authToken, buf)) {
|
||||||
// remove the token because it is a single use token
|
// remove the token because it is a single use token
|
||||||
clusterTokens.delete(tabId);
|
clusterTokens.delete(tabId);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user