feat: support google cloud login in client (#1822)

Co-authored-by: Himself65 <himself65@outlook.com>
Co-authored-by: Peng Xiao <pengxiao@outlook.com>
This commit is contained in:
Horus
2023-04-12 02:42:36 +08:00
committed by GitHub
parent 024c469a2c
commit c0669359ed
17 changed files with 252 additions and 42 deletions
+3 -2
View File
@@ -12,8 +12,8 @@ import { jotaiStore } from '@affine/workspace/atom';
import { isValidIPAddress } from '../utils';
let prefixUrl = '/';
if (typeof window === 'undefined') {
// SSR
if (typeof window === 'undefined' || environment.isDesktop) {
// SSR or Desktop
const serverAPI = config.serverAPI;
if (isValidIPAddress(serverAPI.split(':')[0])) {
// This is for Server side rendering support
@@ -21,6 +21,7 @@ if (typeof window === 'undefined') {
} else {
prefixUrl = serverAPI;
}
prefixUrl = prefixUrl.endsWith('/') ? prefixUrl : prefixUrl + '/';
} else {
const params = new URLSearchParams(window.location.search);
params.get('prefixUrl') && (prefixUrl = params.get('prefixUrl') as string);