mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-31 06:33:03 +02:00
22 lines
509 B
TypeScript
22 lines
509 B
TypeScript
import { PluginDefinition } from '@yaakapp/api';
|
|
|
|
export const plugin: PluginDefinition = {
|
|
authentication: {
|
|
name: 'bearer',
|
|
label: 'Bearer Token',
|
|
shortLabel: 'Bearer',
|
|
args: [{
|
|
type: 'text',
|
|
name: 'token',
|
|
label: 'Token',
|
|
optional: true,
|
|
password: true,
|
|
}],
|
|
async onApply(_ctx, { values }) {
|
|
const { token } = values;
|
|
const value = `Bearer ${token}`.trim();
|
|
return { setHeaders: [{ name: 'Authorization', value }] };
|
|
},
|
|
},
|
|
};
|