test(auth): add regression test and packages/ai changelog for loopback ip redirect
This commit is contained in:
@@ -2,6 +2,10 @@
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### Changed
|
||||
|
||||
- Switched Google OAuth callback hostname from `localhost` to `127.0.0.1` to prevent IPv6 loopback fallback delays and proxy routing interception.
|
||||
|
||||
## [16.0.6] - 2026-06-18
|
||||
|
||||
### Added
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
import { describe, expect, it } from "bun:test";
|
||||
import { GoogleOAuthFlow } from "../src/registry/oauth/google-oauth-shared";
|
||||
import type { OAuthController } from "../src/registry/oauth/types";
|
||||
|
||||
describe("GoogleOAuthFlow callback hostname", () => {
|
||||
it("uses 127.0.0.1 as the callback hostname to avoid IPv6 and proxy delays", () => {
|
||||
const ctrl: OAuthController = {
|
||||
onAuth: () => {},
|
||||
};
|
||||
const flow = new GoogleOAuthFlow(ctrl, {
|
||||
clientId: "test-client",
|
||||
clientSecret: "test-secret",
|
||||
authUrl: "https://example.com/auth",
|
||||
tokenUrl: "https://example.com/token",
|
||||
scopes: ["scope1"],
|
||||
callbackPort: 51121,
|
||||
callbackPath: "/callback",
|
||||
});
|
||||
|
||||
expect(flow.callbackHostname).toBe("127.0.0.1");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user