nest-authify
Version:
Complete authentication and authorization package for NestJS - Monolith and Microservices ready with OAuth, JWT, Redis sessions
37 lines (36 loc) • 1.35 kB
TypeScript
import { ChangePasswordDto, LoginRequestDto, RefreshTokenDto, RegisterRequestDto, UserProfileDto } from '../dto/auth.dto';
import { LoginResponse } from '../interfaces/auth-options.interface';
import { BaseAuthService } from '../services/base-auth.service';
export declare class AuthController {
private readonly authService;
constructor(authService: BaseAuthService);
register(registerDto: RegisterRequestDto): Promise<LoginResponse>;
login(loginDto: LoginRequestDto): Promise<LoginResponse>;
getProfile(user: any): Promise<UserProfileDto>;
refresh(refreshDto: RefreshTokenDto): Promise<{
accessToken: string;
expiresIn: number;
}>;
logout(sessionId: string): Promise<{
message: string;
}>;
logoutAll(userId: string): Promise<{
message: string;
}>;
verifyToken(user: any): Promise<{
valid: boolean;
user: UserProfileDto;
}>;
changePassword(userId: string, changePasswordDto: ChangePasswordDto): Promise<{
message: string;
}>;
updateProfile(userId: string, updateData: Partial<any>): Promise<UserProfileDto>;
getSession(user: any, sessionId: string): Promise<{
sessionId: string;
userId: string;
username?: string;
email?: string;
roles: string[];
}>;
private sanitizeUser;
}