feat: migrate authentication to Logto and clear PWA cache
This commit is contained in:
@@ -1,7 +1,26 @@
|
||||
import { createRoot } from 'react-dom/client';
|
||||
import './index.css';
|
||||
import App from './App.tsx';
|
||||
import { LogtoProvider } from '@logto/react';
|
||||
import type { LogtoConfig } from '@logto/react';
|
||||
|
||||
// Require the user to define VITE_LOGTO_APP_ID in Coolify
|
||||
const config: LogtoConfig = {
|
||||
endpoint: 'https://logto.reifonas.cloud',
|
||||
appId: import.meta.env.VITE_LOGTO_APP_ID || '', // Replace or add via Envs!
|
||||
};
|
||||
|
||||
// Force service worker cache clearing because of persistent Clerk error
|
||||
if ('serviceWorker' in navigator) {
|
||||
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
||||
for(let registration of registrations) {
|
||||
registration.unregister();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
createRoot(document.getElementById('root')!).render(
|
||||
<App />
|
||||
<LogtoProvider config={config}>
|
||||
<App />
|
||||
</LogtoProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user