---
title: Third-party callbacks
description: Run an internal function from a verified callback when nobody is signed in.
---

A third-party callback gets its authority from proof that you check at the edge.

1. **Check the proof**

    Check the provider's signature or the auth library's token before accepting its data. Use the identity from the verified callback as input.

2. **Use a signed-out caller**

    Run an internal function with your app's signed-out scope. Reserve system scopes for trusted app code.

    ```ts
    // The auth library supplies the verified identity and signed reset link.
    onResetPassword: ({ user, url }) =>
      registry.as(signedOut).run(accounts.requestReset, { userId: user.id, url }),
    ```

3. **Send the email after commit**

    Emit an event from the mutation. Send the email in a listener. Use a worker, queue, or `waitUntil` so the response does not wait for the email.

Return the same response for known and unknown addresses.

## See also

- [Authorization](/docs/concepts/authorization)
- [Events](/docs/concepts/events)
- [Jobs](/docs/concepts/jobs)
