mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 08:54:54 +00:00
Refactor Visitor Password Controller and Service for Enhanced Security and Functionality
This commit is contained in:
@ -49,8 +49,8 @@ export class VisitorPasswordController {
|
||||
);
|
||||
}
|
||||
}
|
||||
// @ApiBearerAuth()
|
||||
// @UseGuards(JwtAuthGuard)
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Post('temporary-password/online/one-time')
|
||||
async addOnlineTemporaryPassword(
|
||||
@Body() addDoorLockOnlineOneTimeDto: AddDoorLockOnlineOneTimeDto,
|
||||
@ -86,8 +86,6 @@ export class VisitorPasswordController {
|
||||
|
||||
return {
|
||||
statusCode: HttpStatus.CREATED,
|
||||
success: true,
|
||||
message: 'offline temporary password added successfully',
|
||||
data: temporaryPassword,
|
||||
};
|
||||
} catch (error) {
|
||||
@ -112,8 +110,6 @@ export class VisitorPasswordController {
|
||||
|
||||
return {
|
||||
statusCode: HttpStatus.CREATED,
|
||||
success: true,
|
||||
message: 'offline temporary password added successfully',
|
||||
data: temporaryPassword,
|
||||
};
|
||||
} catch (error) {
|
||||
@ -123,7 +119,9 @@ export class VisitorPasswordController {
|
||||
);
|
||||
}
|
||||
}
|
||||
@Get('')
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get()
|
||||
async GetVisitorPassword() {
|
||||
try {
|
||||
return await this.visitorPasswordService.getPasswords();
|
||||
@ -134,6 +132,8 @@ export class VisitorPasswordController {
|
||||
);
|
||||
}
|
||||
}
|
||||
@ApiBearerAuth()
|
||||
@UseGuards(JwtAuthGuard)
|
||||
@Get('/devices')
|
||||
async GetVisitorDevices() {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user