feat: oauth-based login (#7)

This commit is contained in:
Roberto Vidal
2024-07-29 19:31:45 +01:00
committed by GitHub
parent b8a197ed16
commit 7ebc805ffa
17 changed files with 523 additions and 102 deletions

View File

@@ -1,5 +1,6 @@
import { WebContainer } from '@webcontainer/api';
import { WORK_DIR_NAME } from '~/utils/constants';
import { forgetAuth } from '~/lib/auth';
interface WebContainerContext {
loaded: boolean;
@@ -21,7 +22,10 @@ if (!import.meta.env.SSR) {
webcontainer =
import.meta.hot?.data.webcontainer ??
Promise.resolve()
.then(() => WebContainer.boot({ workdirName: WORK_DIR_NAME }))
.then(() => {
forgetAuth();
return WebContainer.boot({ workdirName: WORK_DIR_NAME });
})
.then((webcontainer) => {
webcontainerContext.loaded = true;
return webcontainer;