Move eyre passcode printing into +code generator

This commit is contained in:
Raymond Pasco 2016-03-09 14:37:15 -05:00
parent c0a2ca3c1c
commit e9ec3b2ded
2 changed files with 19 additions and 4 deletions

View File

@ -472,7 +472,7 @@
;input#ship.mono(contenteditable "", placeholder "planet");
==
;input#pass.mono(type "password", placeholder "passcode");
;h2.advice: Your passcode code has been printed to your console.
;h2.advice: Type +{;code:("+code")} in your dojo for your passcode.
;pre:code#err;
==
==
@ -1347,8 +1347,7 @@
?. ?| (~(has in aut.yac) him.ham)
?~(paz.ham | =(u.paz.ham load-secret))
==
~& code=`@t`load-secret
~|([%try 'code' %in %console] !!) :: XX security
~|(%auth-fail !!)
=^ jon ..ya stat-json:(logon:yac him.ham)
=. cug.yac :_(cug.yac (set-cookie %ship (scot %p him.ham)))
(give-json 200 cug.yac jon)
@ -1356,7 +1355,6 @@
::
++ show-login-page
|= ses/(unit hole) ^- (each pest _done)
%- (slog leaf+"login code for {(scow %p our)}: {(trip load-secret)}" ~)
?. ?=($@($~ {$~ $html}) p.pok)
[%& %red ~]
?~ ses

17
gen/code.hoon Normal file
View File

@ -0,0 +1,17 @@
::
:::: /hoon/code/gen
::
/- sole
=+ sole
:- %ask
|= $: {now/@da eny/@uvI bec/beak}
$~
$~
==
^- (sole-result)
%+ sole-yo
:- %leaf
%+ slag 1
%+ scow %p
.^(@p %a /(scot %p p.bec)/code/(scot %da now)/(scot %p p.bec))
sole-no