refactor: migrate environment to BUILD_CONFIG (#8206)
This commit is contained in:
@@ -91,7 +91,7 @@ export class AuthService extends Service {
|
||||
email,
|
||||
// we call it [callbackUrl] instead of [redirect_uri]
|
||||
// to make it clear the url is used to finish the sign-in process instead of redirect after signed-in
|
||||
callbackUrl: `/magic-link?client=${environment.isElectron ? appInfo?.schema : 'web'}`,
|
||||
callbackUrl: `/magic-link?client=${BUILD_CONFIG.isElectron ? appInfo?.schema : 'web'}`,
|
||||
}),
|
||||
headers: {
|
||||
'content-type': 'application/json',
|
||||
|
||||
@@ -5,7 +5,7 @@ import { fromPromise, Service } from '@toeverything/infra';
|
||||
import { BackendError, NetworkError } from '../error';
|
||||
|
||||
export function getAffineCloudBaseUrl(): string {
|
||||
if (environment.isElectron) {
|
||||
if (BUILD_CONFIG.isElectron) {
|
||||
return BUILD_CONFIG.serverUrlPrefix;
|
||||
}
|
||||
const { protocol, hostname, port } = window.location;
|
||||
|
||||
@@ -28,7 +28,7 @@ const getDefaultSubscriptionSuccessCallbackLink = (
|
||||
plan === SubscriptionPlan.AI ? '/ai-upgrade-success' : '/upgrade-success';
|
||||
const urlString = getAffineCloudBaseUrl() + path;
|
||||
const url = new URL(urlString);
|
||||
if (environment.isElectron && appInfo) {
|
||||
if (BUILD_CONFIG.isElectron && appInfo) {
|
||||
url.searchParams.set('schema', appInfo.schema);
|
||||
}
|
||||
return url.toString();
|
||||
|
||||
Reference in New Issue
Block a user