diff --git a/.env.example b/.env.example index 34e78622..668a2442 100644 --- a/.env.example +++ b/.env.example @@ -27,6 +27,10 @@ JMAP_SERVER_URL=https://your-jmap-server.com # Set to "true" to use OAuth instead of basic JMAP authentication # OAUTH_ENABLED=true +# Set to "true" to only allow OAuth login (hides username/password form) +# Requires OAUTH_ENABLED=true +# OAUTH_ONLY=true + # OAuth client ID registered with your identity provider # OAUTH_CLIENT_ID=your-client-id diff --git a/app/[locale]/login/page.tsx b/app/[locale]/login/page.tsx index 7ffe5cf6..bd770b9e 100644 --- a/app/[locale]/login/page.tsx +++ b/app/[locale]/login/page.tsx @@ -29,7 +29,7 @@ export default function LoginPage() { const params = useParams(); const { login, isLoading, error, clearError, isAuthenticated } = useAuthStore(); const { theme, setTheme, initializeTheme } = useThemeStore(); - const { appName, jmapServerUrl: serverUrl, oauthEnabled, oauthClientId, oauthIssuerUrl, rememberMeEnabled, devMode, loginCompanyName, loginImprintUrl, loginPrivacyPolicyUrl, loginWebsiteUrl, isLoading: configLoading, error: configError } = useConfig(); + const { appName, jmapServerUrl: serverUrl, oauthEnabled, oauthOnly, oauthClientId, oauthIssuerUrl, rememberMeEnabled, devMode, loginCompanyName, loginImprintUrl, loginPrivacyPolicyUrl, loginWebsiteUrl, isLoading: configLoading, error: configError } = useConfig(); const [formData, setFormData] = useState({ username: "", @@ -491,6 +491,41 @@ export default function LoginPage() { Dev mode — logging in as dev@localhost
+ ) : oauthOnly ? ( + /* OAuth-only mode: show SSO button only */ ++ {t("error.oauth_discovery_failed")} +
+