mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-10-29 23:04:23 +00:00
feat(ui): allow disabling self-registration in Cloud (#12815)
This commit is contained in:
1 parent
2198ba2d84
commit
9f616a5d43
27 files changed
+461
-26
No files matched your search
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user