0
Fork 0
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:
Gao Sun 2022-03-11 22:04:16 +08:00
parent 38d8196794
commit b9dab8a9da
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
4 changed files with 12 additions and 2 deletions

View file

@ -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">

View file

@ -6,6 +6,7 @@ const Callback = () => {
const { isAuthenticated, isLoading } = useLogto();
const navigate = useNavigate();
// TO-DO: Error handling
useEffect(() => {
if (isAuthenticated && !isLoading) {
navigate('/', { replace: true });

View file

@ -0,0 +1,7 @@
import React from 'react';
const GetStarted = () => {
return <div>GetStarted</div>;
};
export default GetStarted;

View file

@ -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);