UNPKG

nestjs-auth-kit

Version:

A modular and flexible authentication kit for NestJS with JWT, social login, OTP, and password reset.

42 lines (41 loc) 1.59 kB
import { JwtService } from '@nestjs/jwt'; import { OtpService } from './services/otp.service'; import { ForgotPasswordService } from './services/forgot-password.service'; import { AuthOptions } from './interfaces/auth-options.interface'; import { RegisterDto } from './dto/register.dto'; import { User } from './entities/user.entity'; import { Repository } from 'typeorm'; import { LoginDto } from './dto/login.dto'; export declare class AuthService { private readonly jwtService; private readonly otpService; private readonly forgotPasswordService; private readonly authOptions; private readonly userRepository; constructor(jwtService: JwtService, otpService: OtpService, forgotPasswordService: ForgotPasswordService, authOptions: AuthOptions, userRepository: Repository<User>); register(registerDto: RegisterDto): Promise<{ message: string; user: { id?: string; firstName?: string; lastName?: string; email?: string; roles?: string[]; otps?: import("./entities/otp.entity").OtpEntity[]; }; }>; login(loginDto: LoginDto): Promise<{ access_token: string; }>; validateGoogleUser(profile: any): Promise<{ email: any; userId: any; }>; validateFacebookUser(profile: any): Promise<{ email: any; userId: any; }>; sendOtp(email: string): Promise<string>; verifyOtp(email: string, otp: string): Promise<boolean>; resetPassword(email: string, otp: string, newPassword: string): Promise<void>; }