mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-22 06:41:46 +00:00
chore: apply prettier on the entire project
This commit is contained in:
@@ -4,17 +4,13 @@
|
||||
* Provides utilities to generate JWTs and authenticate supertest requests
|
||||
* using the fixed test JWT_SECRET from TEST_CONFIG.
|
||||
*/
|
||||
import { TEST_CONFIG } from './test-db';
|
||||
|
||||
import jwt from 'jsonwebtoken';
|
||||
import { TEST_CONFIG } from './test-db';
|
||||
|
||||
/** Signs a JWT for the given user ID using the test secret. */
|
||||
export function generateToken(userId: number, extraClaims: Record<string, unknown> = {}): string {
|
||||
return jwt.sign(
|
||||
{ id: userId, ...extraClaims },
|
||||
TEST_CONFIG.JWT_SECRET,
|
||||
{ algorithm: 'HS256', expiresIn: '1h' }
|
||||
);
|
||||
return jwt.sign({ id: userId, ...extraClaims }, TEST_CONFIG.JWT_SECRET, { algorithm: 'HS256', expiresIn: '1h' });
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user