feat(auth): expose audited mobile password change
This commit is contained in:
@@ -13,6 +13,7 @@ import type {
|
||||
import { CurrentAuth } from './decorators/current-auth.decorator';
|
||||
import { Public } from './decorators/public.decorator';
|
||||
import { SkipCsrf } from './decorators/skip-csrf.decorator';
|
||||
import { ChangePasswordDto } from './dto/change-password.dto';
|
||||
import { LoginDto } from './dto/login.dto';
|
||||
import { MobileRefreshDto } from './dto/mobile-refresh.dto';
|
||||
import { MobileAuthService } from './mobile-auth.service';
|
||||
@@ -53,4 +54,15 @@ export class MobileAuthController {
|
||||
) {
|
||||
return this.mobileAuth.logout(principal, request);
|
||||
}
|
||||
|
||||
@Post('change-password')
|
||||
@HttpCode(200)
|
||||
@Throttle({ default: { limit: 10, ttl: 60_000 } })
|
||||
changePassword(
|
||||
@CurrentAuth() principal: AuthPrincipal,
|
||||
@Body() dto: ChangePasswordDto,
|
||||
@Req() request: RequestWithContext,
|
||||
) {
|
||||
return this.mobileAuth.changePassword(principal, dto, request);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user