mirror of
https://github.com/ilyakooo0/urbit.git
synced 2024-12-15 18:12:47 +03:00
df868e2c4f
Jael now stores a `step` that is combined with the original salt to produce a new code. A `%step` card is used to increment that value, and effectively resetting the keys. Because the first `step` is zero, the first code is the same as before. Eyre was changed to be notified with `%code-changed` so it can forget old cookies, sessions and discard all the existing channels. A new generator was added |code, that does both querying and resetting the code |code :: shows current code, step and help |code %reset :: changes the code The old +code generator still works correctly.
31 lines
621 B
Plaintext
31 lines
621 B
Plaintext
:: Helm: query or reset login code for web
|
|
::
|
|
:::: /hoon/code/hood/gen
|
|
::
|
|
/? 310
|
|
::
|
|
::::
|
|
::
|
|
:- %say
|
|
|= $: [now=@da eny=@uvJ bec=beak]
|
|
[arg=?(~ [%reset ~]) ~]
|
|
==
|
|
=* our p.bec
|
|
:- %helm-code
|
|
?~ arg
|
|
=/ code=tape
|
|
%+ slag 1
|
|
%+ scow %p
|
|
.^(@p %j /(scot %p our)/code/(scot %da now)/(scot %p our))
|
|
=/ step=tape
|
|
%+ scow %ud
|
|
.^(@ud %j /(scot %p our)/step/(scot %da now)/(scot %p our))
|
|
%- %- slog
|
|
:~ [%leaf code]
|
|
[%leaf (weld "current step=" step)]
|
|
[%leaf "use |code %reset to invalidate this and generate a new code"]
|
|
==
|
|
~
|
|
?> =(%reset -.arg)
|
|
%reset
|