mirror of
https://github.com/n08i40k/schedule-parser-next.git
synced 2025-12-06 09:47:46 +03:00
1.4.0
Энд-поинт schedule/get-group-names теперь не требует авторизации (для формы регистрации). Энд-поинт schedule/get-group теперь не требует указания группы. Она берётся из данных пользователя. Энд-поинт auth/sign-in теперь может возвращать группу пользователя начиная с версии 1.
This commit is contained in:
@@ -9,7 +9,7 @@ import { JwtService } from "@nestjs/jwt";
|
||||
import { Request } from "express";
|
||||
import { UsersService } from "../users/users.service";
|
||||
import { Reflector } from "@nestjs/core";
|
||||
import { AuthRoles } from "../auth-role/auth-role.decorator";
|
||||
import { AuthRoles, AuthUnauthorized } from "../auth-role/auth-role.decorator";
|
||||
import { isJWT } from "class-validator";
|
||||
|
||||
@Injectable()
|
||||
@@ -30,6 +30,9 @@ export class AuthGuard implements CanActivate {
|
||||
}
|
||||
|
||||
async canActivate(context: ExecutionContext): Promise<boolean> {
|
||||
if (this.reflector.get(AuthUnauthorized, context.getHandler()))
|
||||
return true;
|
||||
|
||||
const request = context.switchToHttp().getRequest();
|
||||
const token = AuthGuard.extractTokenFromRequest(request);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user