-
Notifications
You must be signed in to change notification settings - Fork 297
Expand file tree
/
Copy pathauth.module.ts
More file actions
35 lines (34 loc) · 970 Bytes
/
auth.module.ts
File metadata and controls
35 lines (34 loc) · 970 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { Module } from '@nestjs/common';
import { AuthModule as BetterAuthModule } from '@thallesp/nestjs-better-auth';
import { auth } from './auth.server';
import { ApiKeyGuard } from './api-key.guard';
import { ApiKeyService } from './api-key.service';
import { HybridAuthGuard } from './hybrid-auth.guard';
import { InternalTokenGuard } from './internal-token.guard';
import { PermissionGuard } from './permission.guard';
@Module({
imports: [
// Better Auth NestJS integration - handles /api/auth/* routes
BetterAuthModule.forRoot({
auth,
// Don't register global auth guard - we use HybridAuthGuard
disableGlobalAuthGuard: true,
}),
],
providers: [
ApiKeyService,
ApiKeyGuard,
HybridAuthGuard,
InternalTokenGuard,
PermissionGuard,
],
exports: [
ApiKeyService,
ApiKeyGuard,
HybridAuthGuard,
InternalTokenGuard,
PermissionGuard,
BetterAuthModule,
],
})
export class AuthModule {}