@wikiccu/nest-auth
Version:
A comprehensive authentication package for NestJS applications with Prisma and PostgreSQL
36 lines (35 loc) • 1.82 kB
TypeScript
import { AuthService } from '../services/auth.service';
import { RegisterDto, LoginDto, ForgotPasswordDto, ResetPasswordDto, ChangePasswordDto, VerifyEmailDto, ResendVerificationDto, RefreshTokenDto, LogoutDto, CreateUserDto, UpdateUserDto } from '../dto/auth.dto';
import { AuthUser, LoginResponse, RegisterResponse, PasswordResetResponse, EmailVerificationResponse, RefreshTokenResponse } from '../types';
export declare class AuthController {
private readonly authService;
constructor(authService: AuthService);
register(registerDto: RegisterDto): Promise<RegisterResponse>;
login(loginDto: LoginDto, req: any): Promise<LoginResponse>;
refreshToken(refreshTokenDto: RefreshTokenDto): Promise<RefreshTokenResponse>;
logout(logoutDto: LogoutDto): Promise<{
message: string;
}>;
forgotPassword(forgotPasswordDto: ForgotPasswordDto): Promise<PasswordResetResponse>;
resetPassword(resetPasswordDto: ResetPasswordDto): Promise<{
message: string;
}>;
verifyEmail(verifyEmailDto: VerifyEmailDto): Promise<EmailVerificationResponse>;
resendVerification(resendVerificationDto: ResendVerificationDto): Promise<EmailVerificationResponse>;
getProfile(user: AuthUser): Promise<AuthUser>;
updateProfile(user: AuthUser, updateUserDto: UpdateUserDto): Promise<AuthUser>;
changePassword(user: AuthUser, changePasswordDto: ChangePasswordDto): Promise<{
message: string;
}>;
getUsers(page?: number, limit?: number): Promise<{
users: AuthUser[];
total: number;
page: number;
limit: number;
}>;
createUser(createUserDto: CreateUserDto): Promise<AuthUser>;
updateUser(id: string, updateUserDto: UpdateUserDto): Promise<AuthUser>;
deleteUser(id: string): Promise<{
message: string;
}>;
}