Update: keys cant be updated (for security reasons)

ref #56
This commit is contained in:
2020-12-29 21:00:43 +01:00
parent 04813173e4
commit b53b5cf91f
4 changed files with 8 additions and 56 deletions

View File

@@ -1,5 +1,5 @@
import * as argon2 from "argon2";
import { IsBoolean, IsOptional, IsString } from 'class-validator';
import { IsOptional, IsString } from 'class-validator';
import crypto from 'crypto';
import * as uuid from 'uuid';
import { StatsClient } from '../entities/StatsClient';
@@ -15,13 +15,6 @@ export class CreateStatsClient {
@IsOptional()
description?: string;
/**
* Is the new client enabled.
*/
@IsBoolean()
@IsOptional()
enabled?: boolean;
/**
* Converts this to a StatsClient entity.
*/
@@ -35,9 +28,6 @@ export class CreateStatsClient {
newClient.key = await argon2.hash(newClient.prefix + "." + newUUID);
newClient.cleartextkey = newClient.prefix + "." + newUUID;
if (this.enabled === undefined || this.enabled === null) { newClient.enabled = true; }
else { newClient.enabled = this.enabled }
return newClient;
}
}