Source Code added
This commit is contained in:
parent
800376eafd
commit
9efa9bc6dd
3912 changed files with 754770 additions and 2 deletions
24
server/src/controllers/auth-admin.controller.ts
Normal file
24
server/src/controllers/auth-admin.controller.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
import { Controller, HttpCode, HttpStatus, Post } from '@nestjs/common';
|
||||
import { ApiTags } from '@nestjs/swagger';
|
||||
import { Endpoint, HistoryBuilder } from 'src/decorators';
|
||||
import { AuthDto } from 'src/dtos/auth.dto';
|
||||
import { ApiTag, Permission } from 'src/enum';
|
||||
import { Auth, Authenticated } from 'src/middleware/auth.guard';
|
||||
import { AuthAdminService } from 'src/services/auth-admin.service';
|
||||
|
||||
@ApiTags(ApiTag.AuthenticationAdmin)
|
||||
@Controller('admin/auth')
|
||||
export class AuthAdminController {
|
||||
constructor(private service: AuthAdminService) {}
|
||||
@Post('unlink-all')
|
||||
@Authenticated({ permission: Permission.AdminAuthUnlinkAll, admin: true })
|
||||
@HttpCode(HttpStatus.NO_CONTENT)
|
||||
@Endpoint({
|
||||
summary: 'Unlink all OAuth accounts',
|
||||
description: 'Unlinks all OAuth accounts associated with user accounts in the system.',
|
||||
history: new HistoryBuilder().added('v1').beta('v1').stable('v2'),
|
||||
})
|
||||
unlinkAllOAuthAccountsAdmin(@Auth() auth: AuthDto): Promise<void> {
|
||||
return this.service.unlinkAll(auth);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue