mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-20 16:01:18 +02:00
Work required to support the JWT plugin
This commit is contained in:
@@ -3844,10 +3844,8 @@ var plugin = {
|
||||
const { algorithm, secret: _secret, secretBase64, payload } = args.config;
|
||||
const secret = secretBase64 ? Buffer.from(`${_secret}`, "base64") : `${_secret}`;
|
||||
const token = import_jsonwebtoken.default.sign(`${payload}`, secret, { algorithm });
|
||||
return {
|
||||
url: args.url,
|
||||
headers: [{ name: "Authorization", value: `Bearer ${token}` }]
|
||||
};
|
||||
const value = `Bearer ${token}`;
|
||||
return { setHeaders: [{ name: "Authorization", value }] };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user