mirror of
https://github.com/myfatemi04/wheelshare-old-backend.git
synced 2025-04-20 19:50:17 -04:00
11 lines
283 B
TypeScript
11 lines
283 B
TypeScript
import { IncomingMessage } from 'http';
|
|
|
|
export default function getSessionID(request: IncomingMessage): string | null {
|
|
const auth = request.headers.authorization;
|
|
if (typeof auth === 'string' && auth.startsWith('Bearer ')) {
|
|
return auth.slice(7);
|
|
} else {
|
|
return null;
|
|
}
|
|
}
|