UNPKG

@seas-computing/nestjs-harvard-key

Version:

This repository provides a way to connect NestJS applications to HarvardKey and provide a rudimentary form of authorization (in the form of route guards) out of the box

9 lines (8 loc) 446 B
import { CanActivate, ExecutionContext } from '@nestjs/common'; import { Observable } from 'rxjs'; import { User } from './types/User'; export declare class RequireGroupGuard<UserType extends User, GroupType extends UserType['memberOf'][number] = string> implements CanActivate { private requiredGroup; constructor(requiredGroup: GroupType); canActivate(context: ExecutionContext): boolean | Promise<boolean> | Observable<boolean>; }