@voyant-travel/hono 0.127.1 → 0.127.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/middleware/auth.js +8 -1
- package/package.json +1 -1
package/dist/middleware/auth.js
CHANGED
|
@@ -122,8 +122,15 @@ function applyAuthContext(c, auth) {
|
|
|
122
122
|
c.set("callerType", auth.callerType);
|
|
123
123
|
if (auth.actor)
|
|
124
124
|
c.set("actor", auth.actor);
|
|
125
|
-
if (auth.audience)
|
|
125
|
+
if (auth.audience !== undefined) {
|
|
126
126
|
c.set("audience", auth.audience);
|
|
127
|
+
}
|
|
128
|
+
else if (auth.actor) {
|
|
129
|
+
// VoyantAuthContext defines an omitted grant audience as the authenticated
|
|
130
|
+
// actor. Normalize once here so every downstream surface, including MCP,
|
|
131
|
+
// receives the same complete authorization context.
|
|
132
|
+
c.set("audience", auth.actor);
|
|
133
|
+
}
|
|
127
134
|
if (auth.scopes !== undefined)
|
|
128
135
|
c.set("scopes", auth.scopes);
|
|
129
136
|
if (auth.isInternalRequest !== undefined)
|