From 6a61406989900d07ec2306328998185956a4a5a2 Mon Sep 17 00:00:00 2001 From: L4168 <L4168@student.jamk.fi> Date: Tue, 2 Jul 2019 07:59:20 +0300 Subject: [PATCH] excluded passwords --- src/faction/faction.entity.ts | 6 +++++- src/user/user.entity.ts | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/faction/faction.entity.ts b/src/faction/faction.entity.ts index 410723c..42f3aca 100644 --- a/src/faction/faction.entity.ts +++ b/src/faction/faction.entity.ts @@ -12,6 +12,7 @@ import { import { GameEntity } from '../game/game.entity'; import { Game_PersonEntity } from '../game/game.entity'; import { MapDrawingEntity } from '../draw/coordinate.entity'; +import { Exclude } from 'class-transformer'; //Faction, PowerUp, Faction_powerUp, FP_History, Score @@ -19,9 +20,12 @@ import { MapDrawingEntity } from '../draw/coordinate.entity'; export class FactionEntity { @PrimaryGeneratedColumn('uuid') factionId: string; @Column('text') factionName: string; - @Column({ type: 'text' }) factionPassword: string; @Column({ type: 'float' }) multiplier: number; + @Exclude() + @Column({ type: 'text' }) + factionPassword: string; + @OneToMany(type => Game_PersonEntity, game_persons => game_persons.faction) game_persons: Game_PersonEntity[]; @ManyToOne(type => GameEntity, game => game.factions) diff --git a/src/user/user.entity.ts b/src/user/user.entity.ts index 20f16a0..f095a70 100644 --- a/src/user/user.entity.ts +++ b/src/user/user.entity.ts @@ -9,12 +9,16 @@ import * as bcrypt from 'bcryptjs'; import * as jwt from 'jsonwebtoken'; import { Game_PersonEntity } from '../game/game.entity'; +import { Exclude } from 'class-transformer'; @Entity('Person') export class PersonEntity { @PrimaryGeneratedColumn('uuid') id: string; @Column({ type: 'text', unique: true }) name: string; - @Column('text') password: string; + + @Exclude() + @Column('text') + password: string; @OneToMany(type => Game_PersonEntity, game_persons => game_persons.person) game_persons: Game_PersonEntity[]; -- GitLab