Skip to content

Commit

Permalink
Merge pull request #286 from tloncorp/hm/better-lure-url-fetching
Browse files Browse the repository at this point in the history
reel: new endpoint for getting urls async
  • Loading branch information
arthyn authored Sep 17, 2024
2 parents 6c6adca + 10be27d commit 5fc7a56
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion desk/app/reel.hoon
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@
:: swap out the nonce for the token in our-metadata
=. our-metadata
(~(put by (~(del by our-metadata) nonce)) token u.md)
`this
:_ this
=/ url (cat 3 vic token)
=/ path (stab (cat 3 '/v1/id-link/' id))
~[[%give %fact ~[path] %json !>(s+url)]]
::
%reel-undescribe
?> =(our.bowl src.bowl)
Expand Down Expand Up @@ -238,6 +241,16 @@
:~ [%pass +.pole %agent dock %poke cage]
[%pass /expire/[ship.pole]/[token.pole] %arvo %b [%wait (add ~h1 now.bowl)]]
==
::
[%v1 %id-link id=*]
=/ id (crip +:(spud id.pole))
?~ token=(~(get by stable-id) id) `this
?: (~(has in open-describes) u.token)
:: when the confirmation comes back we'll send the fact
`this
=/ url (cat 3 vic u.token)
:_ this
~[[%give %fact ~[pole] %json !>(s+url)]]
==
::
++ on-leave on-leave:def
Expand Down

0 comments on commit 5fc7a56

Please sign in to comment.