feat(ui): allow disabling self-registration in Cloud (#12815)

This commit is contained in:
Pedro Martín authored and GitHub committed 2026-09-16 14:00:54 +02:00
1 parent 2198ba2d84
commit 9f616a5d43
27 files changed
+461 -26

No files matched your search

+6
View File
@@ -7,6 +7,7 @@ import {
getAttributionParamsFromCallbackPath,
getInvitationTokenFromCallbackPath,
getSafeCallbackPath,
isSelfRegistrationDisabledResponse,
} from "@/lib/auth-callback-url";
import { apiBaseUrl, baseUrl } from "@/lib/helper";
@@ -44,6 +45,11 @@ export async function GET(req: Request) {
});
if (!response.ok) {
if (await isSelfRegistrationDisabledResponse(response)) {
return NextResponse.redirect(
new URL("/sign-in?error=SelfRegistrationDisabled", baseUrl),
);
}
throw new Error("Failed to exchange code for tokens");
}