import { LogtoProvider, useLogto } from '@logto/react';
import { demoAppApplicationId } from '@logto/schemas/lib/seeds';
import React, { useEffect } from 'react';
import '@/scss/normalized.scss';
import * as styles from './App.module.scss';
import Callback from './Callback';
import congrats from './assets/congrats.svg';
const Main = () => {
const { isAuthenticated, signIn } = useLogto();
const isInCallback = Boolean(new URL(window.location.href).searchParams.get('code'));
// Pending SDK fix
const username = 'foo';
const userId = 'bar';
useEffect(() => {
if (!isAuthenticated && !isInCallback) {
void signIn(window.location.href);
}
}, [isAuthenticated, isInCallback, signIn]);
if (isInCallback) {
return
Username: {username}
User ID: {userId}