feat(mobile): ios oauth & magic-link login (#8581)

Co-authored-by: EYHN <cneyhn@gmail.com>
This commit is contained in:
Cats Juice
2024-10-28 14:12:33 +08:00
committed by GitHub
parent d6ec4cc597
commit 06dda70319
59 changed files with 929 additions and 219 deletions

View File

@@ -7,6 +7,7 @@ import { configureCommonModules } from '@affine/core/modules';
import { I18nProvider } from '@affine/core/modules/i18n';
import { configureLocalStorageStateStorageImpls } from '@affine/core/modules/storage';
import { CustomThemeModifier } from '@affine/core/modules/theme-editor';
import { PopupWindowProvider } from '@affine/core/modules/url';
import { configureIndexedDBUserspaceStorageProvider } from '@affine/core/modules/userspace';
import { configureBrowserWorkbenchModule } from '@affine/core/modules/workbench';
import {
@@ -37,6 +38,25 @@ configureLocalStorageStateStorageImpls(framework);
configureBrowserWorkspaceFlavours(framework);
configureIndexedDBWorkspaceEngineStorageProvider(framework);
configureIndexedDBUserspaceStorageProvider(framework);
framework.impl(PopupWindowProvider, {
open: (target: string) => {
const targetUrl = new URL(target);
let url: string;
// safe to open directly if in the same origin
if (targetUrl.origin === location.origin) {
url = target;
} else {
const redirectProxy = location.origin + '/redirect-proxy';
const search = new URLSearchParams({
redirect_uri: target,
});
url = `${redirectProxy}?${search.toString()}`;
}
window.open(url, '_blank', 'noreferrer noopener');
},
});
const frameworkProvider = framework.provider();
// setup application lifecycle events, and emit application start event