@better-auth/oauth-provider 1.5.0 → 1.5.1-beta.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/index.mjs +3 -3
- package/dist/index.mjs.map +1 -1
- package/dist/utils-D6kv_BUA.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -444,7 +444,7 @@ async function checkVerificationValue(ctx, opts, code, client_id, redirect_uri)
|
|
|
444
444
|
error_description: "Invalid code",
|
|
445
445
|
error: "invalid_verification"
|
|
446
446
|
});
|
|
447
|
-
|
|
447
|
+
await ctx.context.internalAdapter.deleteVerificationByIdentifier(await storeToken(opts.storeTokens, code, "authorization_code"));
|
|
448
448
|
if (!verification.expiresAt || verification.expiresAt < /* @__PURE__ */ new Date()) throw new APIError("UNAUTHORIZED", {
|
|
449
449
|
error_description: "code expired",
|
|
450
450
|
error: "invalid_verification"
|
|
@@ -1272,7 +1272,7 @@ const DANGEROUS_SCHEMES = [
|
|
|
1272
1272
|
"vbscript:"
|
|
1273
1273
|
];
|
|
1274
1274
|
function isLocalhost(hostname) {
|
|
1275
|
-
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]";
|
|
1275
|
+
return hostname === "localhost" || hostname === "127.0.0.1" || hostname === "[::1]" || hostname.endsWith(".localhost");
|
|
1276
1276
|
}
|
|
1277
1277
|
/**
|
|
1278
1278
|
* Reusable URL validation for OAuth redirect URIs.
|
|
@@ -3745,7 +3745,7 @@ async function redirectWithAuthorizationCode(ctx, opts, verificationValue) {
|
|
|
3745
3745
|
authTime: verificationValue.authTime
|
|
3746
3746
|
})
|
|
3747
3747
|
};
|
|
3748
|
-
|
|
3748
|
+
await ctx.context.internalAdapter.createVerificationValue({
|
|
3749
3749
|
...data,
|
|
3750
3750
|
createdAt: /* @__PURE__ */ new Date(iat * 1e3)
|
|
3751
3751
|
});
|