feat: custom Logto image + auto-redirect to sign-in
- Add docker/logto.Dockerfile: builds custom Logto image with sign-in UI baked into /etc/logto/packages/experience/dist/ - Remove sign-in-ui init container, signinui volume, CUSTOM_UI_PATH (CUSTOM_UI_PATH is Logto Cloud only, not available in OSS) - Remove sign-in build stage from SaaS Dockerfile (now in logto.Dockerfile) - Remove docker/saas-entrypoint.sh (no longer needed) - LoginPage auto-redirects to Logto OIDC on mount instead of showing "Sign in with Logto" button — seamless sign-in experience Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import { useEffect } from 'react';
|
||||
import { useEffect, useRef } from 'react';
|
||||
import { useLogto } from '@logto/react';
|
||||
import { useNavigate } from 'react-router';
|
||||
import { Button, Spinner } from '@cameleer/design-system';
|
||||
import { Spinner } from '@cameleer/design-system';
|
||||
|
||||
export function LoginPage() {
|
||||
const { signIn, isAuthenticated, isLoading } = useLogto();
|
||||
const navigate = useNavigate();
|
||||
const redirected = useRef(false);
|
||||
|
||||
useEffect(() => {
|
||||
if (isAuthenticated) {
|
||||
@@ -13,27 +14,16 @@ export function LoginPage() {
|
||||
}
|
||||
}, [isAuthenticated, navigate]);
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh' }}>
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
const handleLogin = () => {
|
||||
signIn(`${window.location.origin}/platform/callback`);
|
||||
};
|
||||
useEffect(() => {
|
||||
if (!isLoading && !isAuthenticated && !redirected.current) {
|
||||
redirected.current = true;
|
||||
signIn(`${window.location.origin}/platform/callback`);
|
||||
}
|
||||
}, [isLoading, isAuthenticated, signIn]);
|
||||
|
||||
return (
|
||||
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', minHeight: '100vh' }}>
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
<h1>Cameleer SaaS</h1>
|
||||
<p style={{ marginBottom: '2rem', color: 'var(--color-text-secondary)' }}>
|
||||
Managed Apache Camel Runtime
|
||||
</p>
|
||||
<Button onClick={handleLogin}>Sign in with Logto</Button>
|
||||
</div>
|
||||
<Spinner />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user