mirror of
https://github.com/toeverything/AFFiNE.git
synced 2024-12-28 11:53:24 +03:00
fix: add gettoken on affine provider
This commit is contained in:
parent
82c261767f
commit
fca165c672
@ -17,7 +17,6 @@ import { getLogger } from './logger';
|
||||
import { createBlocksuiteWorkspace } from './utils/index.js';
|
||||
import { MessageCenter } from './message';
|
||||
import { WorkspaceUnit } from './workspace-unit';
|
||||
import { token } from './provider/affine/apis/token';
|
||||
/**
|
||||
* @class DataCenter
|
||||
* @classdesc Data center is made for managing different providers for business
|
||||
@ -169,7 +168,7 @@ export class DataCenter {
|
||||
const params: StoreOptions = {};
|
||||
if (provider.id === 'affine') {
|
||||
params.blobOptionsGetter = (k: string) =>
|
||||
({ api: '/api/workspace', token: token.token }[k]);
|
||||
({ api: '/api/workspace', token: provider.getToken() }[k]);
|
||||
} else {
|
||||
params.blobOptionsGetter = (k: string) => undefined;
|
||||
}
|
||||
|
@ -360,6 +360,10 @@ export class AffineProvider extends BaseProvider {
|
||||
await this._apis.updateWorkspace({ id, public: isPublish });
|
||||
}
|
||||
|
||||
public override getToken(): string {
|
||||
return this._apis.token.token;
|
||||
}
|
||||
|
||||
public override async getUserByEmail(
|
||||
workspace_id: string,
|
||||
email: string
|
||||
|
@ -82,7 +82,7 @@ export const migrateBlobDB = async (
|
||||
return [id, { id, blob }] as [string, PendingTask];
|
||||
});
|
||||
await newPendingDB.setMany(pendingEntries);
|
||||
|
||||
await oldDB.deleteDB();
|
||||
await oldPendingDB.deleteDB();
|
||||
// FIXME: delete old db
|
||||
// await oldDB.deleteDB();
|
||||
// await oldPendingDB.deleteDB();
|
||||
};
|
||||
|
@ -64,6 +64,10 @@ export class BaseProvider {
|
||||
return;
|
||||
}
|
||||
|
||||
public getToken(): string {
|
||||
return '';
|
||||
}
|
||||
|
||||
/**
|
||||
* warp workspace with provider functions
|
||||
* @param workspace
|
||||
|
Loading…
Reference in New Issue
Block a user