@cloudflare/workers-oauth-provider 0.0.0-239e753 → 0.0.0-68e3f97
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/oauth-provider.js +5 -4
- package/package.json +2 -1
package/dist/oauth-provider.js
CHANGED
|
@@ -736,7 +736,7 @@ var OAuthProviderImpl = class {
|
|
|
736
736
|
} else if (isRefreshToken) {
|
|
737
737
|
await this.createOAuthHelpers(env).revokeGrant(grantId, userId);
|
|
738
738
|
}
|
|
739
|
-
return new Response("", { status:
|
|
739
|
+
return new Response("", { status: 200 });
|
|
740
740
|
}
|
|
741
741
|
/**
|
|
742
742
|
* Revokes a specific access token without affecting the refresh token
|
|
@@ -1174,15 +1174,16 @@ var OAuthHelpersImpl = class {
|
|
|
1174
1174
|
const state = url.searchParams.get("state") || "";
|
|
1175
1175
|
const codeChallenge = url.searchParams.get("code_challenge") || void 0;
|
|
1176
1176
|
const codeChallengeMethod = url.searchParams.get("code_challenge_method") || "plain";
|
|
1177
|
+
if (!redirectUri.startsWith("http://") && !redirectUri.startsWith("https://")) {
|
|
1178
|
+
throw new Error("Invalid redirect URI");
|
|
1179
|
+
}
|
|
1177
1180
|
if (responseType === "token" && !this.provider.options.allowImplicitFlow) {
|
|
1178
1181
|
throw new Error("The implicit grant flow is not enabled for this provider");
|
|
1179
1182
|
}
|
|
1180
1183
|
if (clientId) {
|
|
1181
1184
|
const clientInfo = await this.lookupClient(clientId);
|
|
1182
1185
|
if (!clientInfo) {
|
|
1183
|
-
throw new Error(
|
|
1184
|
-
`Invalid client. The clientId provided does not match to this client.`
|
|
1185
|
-
);
|
|
1186
|
+
throw new Error(`Invalid client. The clientId provided does not match to this client.`);
|
|
1186
1187
|
}
|
|
1187
1188
|
if (clientInfo && redirectUri) {
|
|
1188
1189
|
if (!clientInfo.redirectUris.includes(redirectUri)) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cloudflare/workers-oauth-provider",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-68e3f97",
|
|
4
4
|
"description": "OAuth provider for Cloudflare Workers",
|
|
5
5
|
"main": "dist/oauth-provider.js",
|
|
6
6
|
"types": "dist/oauth-provider.d.ts",
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@changesets/changelog-github": "^0.5.1",
|
|
29
29
|
"@changesets/cli": "^2.29.5",
|
|
30
30
|
"@cloudflare/workers-types": "^4.20250807.0",
|
|
31
|
+
"pkg-pr-new": "^0.0.59",
|
|
31
32
|
"prettier": "^3.6.2",
|
|
32
33
|
"tsup": "^8.5.0",
|
|
33
34
|
"tsx": "^4.20.3",
|