fix(auth): restore BetterAuth OIDC flow across api/web/compose
This commit is contained in:
@@ -276,7 +276,7 @@ describe("LoginPage", (): void => {
|
||||
|
||||
expect(mockOAuth2).toHaveBeenCalledWith({
|
||||
providerId: "authentik",
|
||||
callbackURL: "/",
|
||||
callbackURL: "http://localhost:3000/",
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -113,7 +113,9 @@ function LoginPageContent(): ReactElement {
|
||||
const handleOAuthLogin = useCallback((providerId: string): void => {
|
||||
setOauthLoading(providerId);
|
||||
setError(null);
|
||||
signIn.oauth2({ providerId, callbackURL: "/" }).catch((err: unknown) => {
|
||||
const callbackURL =
|
||||
typeof window !== "undefined" ? new URL("/", window.location.origin).toString() : "/";
|
||||
signIn.oauth2({ providerId, callbackURL }).catch((err: unknown) => {
|
||||
const message = err instanceof Error ? err.message : String(err);
|
||||
console.error(`[Auth] OAuth sign-in initiation failed for ${providerId}:`, message);
|
||||
setError("Unable to connect to the sign-in provider. Please try again in a moment.");
|
||||
|
||||
Reference in New Issue
Block a user