chore: consolidate new foundation and archive v1 (#1495)
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { Global, Module } from '@nestjs/common';
|
||||
import { createAuth, type Auth } from '@mosaicstack/auth';
|
||||
import type { Db } from '@mosaicstack/db';
|
||||
import { DB } from '../database/database.module.js';
|
||||
import { AUTH } from './auth.tokens.js';
|
||||
import { SsoController } from './sso.controller.js';
|
||||
|
||||
@Global()
|
||||
@Module({
|
||||
controllers: [SsoController],
|
||||
providers: [
|
||||
{
|
||||
provide: AUTH,
|
||||
useFactory: (db: Db): Auth =>
|
||||
createAuth({
|
||||
db,
|
||||
baseURL: process.env['BETTER_AUTH_URL'] ?? 'http://localhost:14242',
|
||||
secret: process.env['BETTER_AUTH_SECRET'],
|
||||
}),
|
||||
inject: [DB],
|
||||
},
|
||||
],
|
||||
exports: [AUTH],
|
||||
})
|
||||
export class AuthModule {}
|
||||
Reference in New Issue
Block a user