View as Markdown

Let the person withdraw#

The person takes an approval back on their node; your app refuses it from the next refresh.

Level 1: A person approves with a passkey.
Class read: Nothing changes. The approval can be reused until it ends or the person withdraws it.
routes.append(route("GET", "/export", "notes:export", level=1, resource="note:*", summary="Export your notes"))
templates["notes:export"] = "Export your notes"


@app.get("/export")
def export():
    # Once the person withdraws this approval, the SDK answers 401 revoked. Keep its id with what you do.
    return {"approval": g.allowedby.gid, "notes": notes.list(g.allowedby.human_id)}

What the test proves#

  • the person approves, and the app knows which approval it served
  • the person withdraws it: from the next refresh, 401 revoked
  • their other approvals still work
  • asked again, the person may approve again: a new approval, 200