se agregaron funciones para actualizar usuario
This commit is contained in:
@@ -7,10 +7,10 @@ import {
|
||||
UnauthorizedException,
|
||||
} from '@nestjs/common';
|
||||
import { AuthService } from './auth.service';
|
||||
|
||||
|
||||
@Controller('auth')
|
||||
export class AuthController {
|
||||
constructor(private readonly authService: AuthService) {}
|
||||
constructor(private readonly authService: AuthService) { }
|
||||
|
||||
// ===================== LOGIN =====================
|
||||
@Post('login')
|
||||
@@ -36,4 +36,15 @@ export class AuthController {
|
||||
throw new UnauthorizedException(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
// ===================== ACTUALIZAR CONTRASEÑA ADMIN =====================
|
||||
@Post('update-password')
|
||||
async updatePassword() {
|
||||
try {
|
||||
const newPassword = await this.authService.update_password();
|
||||
return { message: 'Contraseña actualizada correctamente.', contraseña: newPassword };
|
||||
} catch (error) {
|
||||
throw new UnauthorizedException(error.message);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user