mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-10-21 14:36:31 +00:00
refactor(server): auth, oidc and admin nest modules read env via app-config
This commit is contained in:
@@ -20,6 +20,7 @@ import type { Request, Response } from 'express';
|
||||
import path from 'path';
|
||||
import fs from 'fs';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import { readEnv } from '../../app-config';
|
||||
import { AuthService } from './auth.service';
|
||||
import { RateLimitService } from './rate-limit.service';
|
||||
import { JwtAuthGuard } from './jwt-auth.guard';
|
||||
@@ -132,7 +133,7 @@ export class AuthController {
|
||||
@HttpCode(200)
|
||||
@UseInterceptors(FileInterceptor('avatar', AVATAR_UPLOAD))
|
||||
async avatar(@CurrentUser() user: User, @UploadedFile() file: Express.Multer.File | undefined) {
|
||||
if (process.env.DEMO_MODE?.toLowerCase() === 'true' && isDemoEmail(user.email)) {
|
||||
if (readEnv().demo.enabled && isDemoEmail(user.email)) {
|
||||
throw new HttpException({ error: 'Uploads are disabled in demo mode. Self-host TREK for full functionality.' }, 403);
|
||||
}
|
||||
if (!file) {
|
||||
|
||||
Reference in New Issue
Block a user