mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-18 23:44:12 +01:00
JWT plugin
This commit is contained in:
@@ -12,15 +12,10 @@ export const plugin: PluginDefinition = {
|
||||
optional: true,
|
||||
password: true,
|
||||
}],
|
||||
async onApply(_ctx: any, args: any): Promise<any> {
|
||||
async onApply(_ctx, args) {
|
||||
const { token } = args.config;
|
||||
return {
|
||||
url: args.url,
|
||||
headers: [{
|
||||
name: 'Authorization',
|
||||
value: `Bearer ${token}`.trim(),
|
||||
}],
|
||||
};
|
||||
const value = `Bearer ${token}`.trim();
|
||||
return { setHeaders: [{ name: 'Authorization', value }] };
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user