first commit

This commit is contained in:
lendry
2026-06-24 14:37:15 +03:00
commit 995adeedd4
188 changed files with 28810 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import { UnauthorizedException } from '@nestjs/common';
export function extractBearerToken(authorization?: string): string {
if (!authorization?.startsWith('Bearer ')) {
throw new UnauthorizedException('Не передан токен доступа');
}
const token = authorization.slice('Bearer '.length).trim();
if (!token) {
throw new UnauthorizedException('Не передан токен доступа');
}
return token;
}