chore(mock-api): 🔧 Update mock API server configuration, database file, and related dependencies
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
This commit is contained in:
parent
9ad43b0af8
commit
6efc92999d
3 changed files with 11 additions and 0 deletions
|
|
@ -414,6 +414,17 @@ const INVALID_TOKENS = new Set([
|
|||
// Expired JWT token (from TEST_AUTH_TOKENS.expired)
|
||||
const EXPIRED_TOKEN = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VySWQiOiJ1c3Jfd29ya2VyXzAwMSIsImVtYWlsIjoid29ya2VyQGF0bGlsaXRoLnRlc3QiLCJyb2xlIjoid29ya2VyIiwiaWF0IjoxNjAwMDAwMDAwLCJleHAiOjE2MDAwMDAwMDF9.test'
|
||||
|
||||
/**
|
||||
* Extract Bearer token from Authorization header
|
||||
*/
|
||||
function extractToken(req) {
|
||||
const authHeader = req.headers.authorization || req.headers.Authorization
|
||||
if (!authHeader) return null
|
||||
|
||||
const match = authHeader.match(/^Bearer\s+(.+)$/i)
|
||||
return match ? match[1] : null
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a Bearer token to a user object.
|
||||
*
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Add table
Reference in a new issue