forked from Yara724/api
23 lines
684 B
TypeScript
23 lines
684 B
TypeScript
import { Injectable } from "@nestjs/common";
|
|
import { PassportStrategy } from "@nestjs/passport";
|
|
import { Strategy } from "passport-local";
|
|
import { ActorAuthService } from "src/auth/auth-services/actor.auth.service";
|
|
|
|
@Injectable()
|
|
export class LocalActorStrategy extends PassportStrategy(Strategy, "actor") {
|
|
constructor(private readonly actorAuthService: ActorAuthService) {
|
|
super();
|
|
}
|
|
|
|
// async validate(username, password): Promise<any> {
|
|
// const user = await this.actorAuthService.validateActor(
|
|
// username,
|
|
// password,
|
|
// );
|
|
// if (!user) {
|
|
// throw new UnauthorizedException("user not found");
|
|
// }
|
|
// return user;
|
|
// }
|
|
}
|