Show why personal OIDC logins are refused

Personal Google and Microsoft accounts were rejected with a raw
JSON unauthorized response after the OIDC callback. Redirect to a
dedicated auth page that explains the enterprise-account
requirement, and check enterprise eligibility before xms_edov so
Microsoft consumer accounts get the same clear error.

Signed-off-by: Cursor Agent <cursoragent@cursor.com>

Co-authored-by: Bryan FRIMIN <bryan@frimin.fr>
This commit is contained in:
Bryan Frimin
2026-07-24 21:16:11 +00:00
committed by Cursor Agent
parent b8c3fb086e
commit d1814d7051
5 changed files with 148 additions and 14 deletions

View File

@@ -0,0 +1,45 @@
// Copyright (c) 2026 Probo Inc <hello@probo.com>.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
import { usePageTitle } from "@probo/hooks";
import { useTranslate } from "@probo/i18n";
import { Button } from "@probo/ui";
export default function PersonalAccountNotAllowedPage() {
const { __ } = useTranslate();
usePageTitle(__("Enterprise account required"));
return (
<div className="space-y-6 w-full">
<div className="space-y-2 text-center">
<h1 className="text-2xl font-bold">{__("Enterprise account required")}</h1>
<p className="text-txt-tertiary">
{__(
"Personal Google and Microsoft accounts cannot be used to sign in. Please use your work or school account instead.",
)}
</p>
</div>
<Button className="w-full h-10" to="/auth/login">
{__("Sign in")}
</Button>
</div>
);
}

View File

@@ -127,6 +127,12 @@ const routes = [
path: "magic-link-already-used",
Component: lazy(() => import("./pages/iam/auth/MagicLinkAlreadyUsedPage")),
},
{
path: "personal-account-not-allowed",
Component: lazy(
() => import("./pages/iam/auth/PersonalAccountNotAllowedPage"),
),
},
],
},
{