How to use the @loopback/core.inject.getter function in @loopback/core

To help you get started, we’ve selected a few @loopback/core examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gobackhuoxing / first-web-game-lb4 / firstgame / src / controllers / update-character.controller.ts View on Github external
constructor(
    @repository(CharacterRepository)
    public characterRepository: CharacterRepository,
    @repository(WeaponRepository)
    public weaponRepository: WeaponRepository,
    @repository(ArmorRepository)
    public armorRepository: ArmorRepository,
    @repository(SkillRepository)
    public skillRepository: SkillRepository,
    //
    @inject.getter(AuthenticationBindings.CURRENT_USER)
    public getCurrentUser: Getter,
  ) {}
github sourcefuse / loopback4-starter / src / repositories / tenant.repository.ts View on Github external
constructor(
    @inject('datasources.pgdb') dataSource: PgdbDataSource,
    @inject.getter(AuthenticationBindings.CURRENT_USER)
    protected readonly getCurrentUser: Getter,
  ) {
    super(Tenant, dataSource, getCurrentUser);
  }
}
github gobackhuoxing / first-web-game-lb4 / firstgame / src / controllers / character.controller.ts View on Github external
constructor(
    @repository(CharacterRepository)
    public characterRepository: CharacterRepository,
    @inject(MyAuthBindings.TOKEN_SERVICE)
    public jwtService: JWTService,
    @inject.getter(AuthenticationBindings.CURRENT_USER)
    public getCurrentUser: Getter,
  ) {}
github iqbaldjulfri / lb4-jwt-role-based-auth-sample / src / auth.ts View on Github external
constructor(
    @inject.getter(MyAuthBindings.STRATEGY) readonly getStrategy: Getter,
    @inject.setter(AuthenticationBindings.CURRENT_USER) readonly setCurrentUser: Setter,
    @inject.getter(AuthenticationBindings.METADATA) readonly getMetadata: Getter,
  ) {}
github sourcefuse / loopback4-starter / src / repositories / user.repository.ts View on Github external
constructor(
    @inject('datasources.pgdb') dataSource: PgdbDataSource,
    @inject.getter(AuthenticationBindings.CURRENT_USER)
    protected readonly getCurrentUser: Getter,
    @repository.getter('UserCredentialsRepository')
    getUserCredsRepository: Getter,
  ) {
    super(User, dataSource, getCurrentUser);
    this.credentials = this.createHasOneRepositoryFactoryFor(
      'credentials',
      getUserCredsRepository,
    );
  }
github sourcefuse / loopback4-starter / src / repositories / user-tenant-permission.repository.ts View on Github external
constructor(
    @inject('datasources.pgdb') dataSource: PgdbDataSource,
    @repository.getter(UserTenantRepository)
    utRepositoryGetter: Getter,
    @inject.getter(AuthenticationBindings.CURRENT_USER)
    protected readonly getCurrentUser: Getter,
  ) {
    super(UserTenantPermission, dataSource, getCurrentUser);

    this.userTenant = this.createBelongsToAccessorFor(
      'user_tenant_id',
      utRepositoryGetter,
    );
  }
}
github iqbaldjulfri / lb4-jwt-role-based-auth-sample / src / auth.ts View on Github external
constructor(
    @inject.getter(MyAuthBindings.STRATEGY) readonly getStrategy: Getter,
    @inject.setter(AuthenticationBindings.CURRENT_USER) readonly setCurrentUser: Setter,
    @inject.getter(AuthenticationBindings.METADATA) readonly getMetadata: Getter,
  ) {}