update websocket

This commit is contained in:
2024-11-06 17:16:10 +07:00
parent ef5c753ce4
commit 57037a59ec
18 changed files with 129 additions and 71 deletions

View File

@@ -43,8 +43,10 @@ export class ClerkAuthGuard implements CanActivate {
request.user = session.user
return true
} catch (error: any) {
throw new UnauthorizedException(error.message)
} catch (error: unknown) {
throw new UnauthorizedException(
error instanceof Error ? error.message : 'Unknown error',
)
}
}
}

View File

@@ -18,7 +18,7 @@ export class ClerkController {
@Post('webhook')
@ApiOperation({ summary: 'Clerk Webhook' })
@ApiResponse({ status: 200, description: 'Webhook created successfully' })
webhook(@Headers() headers: any, @Body() body: any) {
webhook(@Headers() headers: Headers, @Body() body: any) {
return this.clerkService.webhook(body)
}
}

View File

@@ -3,9 +3,7 @@ import { Injectable, Logger } from '@nestjs/common'
import { PrismaService } from '../Prisma/prisma.service'
import { clerkClient } from '@clerk/express'
export interface ClerkResponse {
}
export interface ClerkResponse {}
@Injectable()
export class ClerkService {
constructor(private readonly prisma: PrismaService) {}