14 lines
487 B
TypeScript
14 lines
487 B
TypeScript
|
|
import { describe, it } from 'vitest';
|
|
import jwt from 'jsonwebtoken';
|
|
|
|
describe('Generate Keys', () => {
|
|
it('should generate keys', () => {
|
|
const secret = 'supersecret1234567890123456789012';
|
|
const anon = jwt.sign({ role: 'anon', iss: 'madbase' }, secret, { algorithm: 'HS256' });
|
|
const service = jwt.sign({ role: 'service_role', iss: 'madbase' }, secret, { algorithm: 'HS256' });
|
|
console.log(`ANON_KEY=${anon}`);
|
|
console.log(`SERVICE_KEY=${service}`);
|
|
});
|
|
});
|