mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-04-10 03:13:33 +02:00
Merge plugins repo into mono
This commit is contained in:
21
plugins/auth-bearer/src/index.ts
Normal file
21
plugins/auth-bearer/src/index.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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 }] };
|
||||
},
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user