[resolved] Decrypt multiple inputs by user on GET request
Options
I'm building an app where users can submit journal entries. Each entry can have up to 3 inputs. I have it set so that entries are encrypted in the back end so that I (or anyone else) can't read them. The encrypted POST is working well (screenshot below) and passes the encrypted data into Xano perfectly.
[Screenshot 2021-11-13 at 15.28.43.png]
What I want to build is a GET api that fetches a logged-in users entries and decrypts them so that a user can look over what they have written. I have an api and endpoint setup to GET all of a users entries based on their user ID which is all working, however it doesn't decrypt the entries. (screenshot below)
[Screenshot 2021-11-13 at 15.27.07.png]
I have watched some guides on decrypting and it was touched on in office hours this week, however I can't get it working in tandem with the GET api for the entries.
Any help would be massively appreciated!
[Screenshot 2021-11-13 at 15.28.43.png]
What I want to build is a GET api that fetches a logged-in users entries and decrypts them so that a user can look over what they have written. I have an api and endpoint setup to GET all of a users entries based on their user ID which is all working, however it doesn't decrypt the entries. (screenshot below)
[Screenshot 2021-11-13 at 15.27.07.png]
I have watched some guides on decrypting and it was touched on in office hours this week, however I can't get it working in tandem with the GET api for the entries.
Any help would be massively appreciated!
Comments
-
I think a for each loop would work with a decrypt for each item
-
Thanks Toby. I'm a bit of a noob building these stacks still, do you know what the specifics for that might look like?
-
you would need a for each loop (entries as entry) and then an update variable command. the update variable command would set entry to itself but that would allow you to use several set filters which would then allow you to decode the data on the flow.
visually it would look like this.
foreach: entries as entry
update: var:entry = var:entry
|set("Input1", var:entry.Input1|jwe_decode(...))
|set("Input2", var:entry.Input2|jwe_decode(...))
|set("Input3", var:entry.Input3|jwe_decode(...))
If you come to office hours we could show you this in action fairly quickly.. -
Thanks Sean! It's starting to make a little more sense but booked into Tuesday's office hours. Thanks!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback