forcing accounts for identity proofs for now (doesn't matter)

This commit is contained in:
May 2024-06-25 12:56:09 -07:00
parent c53a31c405
commit 0f7ae63c97
Signed by: split
GPG key ID: C325C61F0BF517C0

View file

@ -49,7 +49,7 @@ export default function () {
return ctx.json(["none"]) // if we add 2fa in the future, return available 2fa methods
})
router.post("/", scheme(
router.post("/", requiresAccount, scheme(
ProofCreationSchema
), async (ctx) => {
@ -68,12 +68,17 @@ export default function () {
// if actor does have 2fa in an else block here
return ctx.text(new CodeMgr.Code(
const tryCode = CodeMgr.code(
"identityProof",
target.id,
Boolean(actor), // so that you can only log in with proofs created when logged out
5 * 60 * 1000
).id)
)
if (!tryCode.success)
return ServeError(ctx, 429, tryCode.error)
return ctx.text(tryCode.code.id)
})
return router