mirror of
https://github.com/logto-io/logto.git
synced 2025-03-10 22:22:45 -05:00
fix(console): connect sign in with core
This commit is contained in:
parent
38d8196794
commit
b9dab8a9da
4 changed files with 12 additions and 2 deletions
|
@ -15,6 +15,7 @@ import ApplicationDetails from './pages/ApplicationDetails';
|
|||
import Applications from './pages/Applications';
|
||||
import ConnectorDetails from './pages/ConnectorDetails';
|
||||
import Connectors from './pages/Connectors';
|
||||
import GetStarted from './pages/GetStarted';
|
||||
import Users from './pages/Users';
|
||||
import { fetcher } from './swr';
|
||||
|
||||
|
@ -33,12 +34,13 @@ const Main = () => {
|
|||
}, [location.pathname, navigate]);
|
||||
|
||||
return (
|
||||
<LogtoProvider logtoConfig={{ endpoint: 'https://logto.dev', clientId: 'foo' }}>
|
||||
<LogtoProvider logtoConfig={{ endpoint: window.location.origin, clientId: 'foo' }}>
|
||||
<SWRConfig value={{ fetcher }}>
|
||||
<Toast />
|
||||
<Routes>
|
||||
<Route path="callback" element={<Callback />} />
|
||||
<Route element={<AppContent theme="light" />}>
|
||||
<Route path="get-started" element={<GetStarted />} />
|
||||
<Route path="applications">
|
||||
<Route index element={<Applications />} />
|
||||
<Route path=":id">
|
||||
|
|
|
@ -6,6 +6,7 @@ const Callback = () => {
|
|||
const { isAuthenticated, isLoading } = useLogto();
|
||||
const navigate = useNavigate();
|
||||
|
||||
// TO-DO: Error handling
|
||||
useEffect(() => {
|
||||
if (isAuthenticated && !isLoading) {
|
||||
navigate('/', { replace: true });
|
||||
|
|
7
packages/console/src/pages/GetStarted/index.tsx
Normal file
7
packages/console/src/pages/GetStarted/index.tsx
Normal file
|
@ -0,0 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
const GetStarted = () => {
|
||||
return <div>GetStarted</div>;
|
||||
};
|
||||
|
||||
export default GetStarted;
|
|
@ -91,7 +91,7 @@ export default async function initOidc(app: Koa): Promise<Provider> {
|
|||
clientBasedCORS: (_, origin) => {
|
||||
console.log('origin', origin);
|
||||
|
||||
return origin.startsWith('http://localhost:3000');
|
||||
return origin.startsWith('http://localhost:3001');
|
||||
},
|
||||
findAccount: async (ctx, sub) => {
|
||||
await findUserById(sub);
|
||||
|
|
Loading…
Add table
Reference in a new issue