mirror of
https://github.com/Blah-IM/typescript-core.git
synced 2025-04-30 16:21:10 +00:00
fix(identity): validate profile on creating identity
This commit is contained in:
parent
067276e367
commit
d699b54ff6
1 changed files with 3 additions and 2 deletions
|
@ -6,7 +6,7 @@ import {
|
|||
import { type ActKeyUpdate, BlahActKey } from "./actKey.ts";
|
||||
import { blahIdentityDescriptionSchema } from "./identityDescription.ts";
|
||||
import type { BlahIdentityDescription } from "./mod.ts";
|
||||
import type { BlahProfile } from "./profile.ts";
|
||||
import { type BlahProfile, blahProfileSchema } from "./profile.ts";
|
||||
|
||||
export class BlahIdentity {
|
||||
private internalIdKey: BlahPublicKey | BlahKeyPair;
|
||||
|
@ -105,7 +105,8 @@ export class BlahIdentity {
|
|||
firstActKeyConfig,
|
||||
);
|
||||
|
||||
const profileRecord = await firstActKey.signPayload(profile);
|
||||
const parsedProfile = blahProfileSchema.parse(profile);
|
||||
const profileRecord = await firstActKey.signPayload(parsedProfile);
|
||||
|
||||
return new BlahIdentity(idKeyPair, [actKey], profileRecord, true);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue