accounts: set nip05 during update_credentials

This commit is contained in:
Alex Gleason
2023-09-11 18:44:44 -05:00
parent 3394474ee2
commit 62ac9bffa3
3 changed files with 12 additions and 2 deletions

View File

@@ -164,6 +164,7 @@ const updateCredentialsSchema = z.object({
const updateCredentialsController: AppController = async (c) => {
const pubkey = c.get('pubkey')!;
const user = c.get('user')!;
const body = await parseBody(c.req.raw);
const result = updateCredentialsSchema.safeParse(body);
@@ -190,6 +191,7 @@ const updateCredentialsController: AppController = async (c) => {
meta.about = note ?? meta.about;
meta.picture = avatar?.url ?? meta.picture;
meta.banner = header?.url ?? meta.banner;
meta.nip05 = `${user.username}@${Conf.url.host}` ?? meta.nip05;
const event = await createEvent({
kind: 0,