Skip to content

Commit 3e551ee

Browse files
committed
feat: pass targetOrigin in handleAuth error responses
Add targetOrigin parameter to error responses in the handleAuth function to ensure error messages are only sent to the originating domain.
1 parent a92074d commit 3e551ee

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/index.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ const handleAuth = async (request, env) => {
117117
provider,
118118
error: 'OAuth app client ID or secret is not configured.',
119119
errorCode: 'MISCONFIGURED_CLIENT',
120+
targetOrigin: referringOrigin || origin,
120121
});
121122
}
122123

@@ -136,6 +137,7 @@ const handleAuth = async (request, env) => {
136137
provider,
137138
error: 'OAuth app client ID or secret is not configured.',
138139
errorCode: 'MISCONFIGURED_CLIENT',
140+
targetOrigin: referringOrigin || origin,
139141
});
140142
}
141143

0 commit comments

Comments
 (0)