auth98: fix nsec flow

This commit is contained in:
Alex Gleason 2023-09-08 18:29:26 -05:00
parent 527e276340
commit dcc9d05ee5
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
2 changed files with 3 additions and 3 deletions

View File

@ -7,7 +7,7 @@ import {
validateAuthEvent, validateAuthEvent,
} from '@/utils/nip98.ts'; } from '@/utils/nip98.ts';
import { localRequest } from '@/utils/web.ts'; import { localRequest } from '@/utils/web.ts';
import { signNostrConnect } from '@/sign.ts'; import { signEvent } from '@/sign.ts';
import { findUser, User } from '@/db/users.ts'; import { findUser, User } from '@/db/users.ts';
/** /**
@ -63,7 +63,7 @@ function matchesRole(user: User, role: UserRole): boolean {
async function obtainProof(c: AppContext, opts?: ParseAuthRequestOpts) { async function obtainProof(c: AppContext, opts?: ParseAuthRequestOpts) {
const req = localRequest(c); const req = localRequest(c);
const reqEvent = await buildAuthEventTemplate(req, opts); const reqEvent = await buildAuthEventTemplate(req, opts);
const resEvent = await signNostrConnect(reqEvent, c); const resEvent = await signEvent(reqEvent, c);
const result = await validateAuthEvent(req, resEvent, opts); const result = await validateAuthEvent(req, resEvent, opts);
if (result.success) { if (result.success) {

View File

@ -99,4 +99,4 @@ async function signAdminEvent<K extends number = number>(event: EventTemplate<K>
return finishEvent(event, Conf.seckey); return finishEvent(event, Conf.seckey);
} }
export { signAdminEvent, signEvent, signNostrConnect }; export { signAdminEvent, signEvent };