mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-21 21:36:26 -08:00
forcing accounts for identity proofs for now (doesn't matter)
This commit is contained in:
parent
c53a31c405
commit
0f7ae63c97
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue