File size: 535 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import { Injectable } from "@nestjs/common";
import { ConfigService } from "@nestjs/config";

import { Config } from "../config/schema";

@Injectable()
export class FeatureService {
  constructor(private readonly configService: ConfigService<Config>) {}

  getFeatures() {
    const isSignupsDisabled = this.configService.getOrThrow<boolean>("DISABLE_SIGNUPS");
    const isEmailAuthDisabled = this.configService.getOrThrow<boolean>("DISABLE_EMAIL_AUTH");

    return {
      isSignupsDisabled,
      isEmailAuthDisabled,
    };
  }
}