constrequest = context.switchToHttp().getRequest(); const { login, sessionId } = request.cookies; if (!login || !sessionId) thrownewAuthorizationNotAuthorizedError(); // get user from db, or somewhere else if (!user) thrownewAuthorizationNotAuthorizedError(); returnuser.role;
Description
Example