mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-20 00:46:01 +00:00
SYNC: cloud test - use test login
This commit is contained in:
committed by
Diflow
parent
74b78141b4
commit
930b3d4538
@@ -93,6 +93,22 @@ async function readCloudTokenHolder(sid) {
|
||||
return null;
|
||||
}
|
||||
|
||||
async function readCloudTestTokenHolder(email) {
|
||||
const resp = await axios.default.post(
|
||||
`${DBGATE_IDENTITY_URL}/api/test-token`,
|
||||
{ email },
|
||||
{
|
||||
headers: {
|
||||
...getLicenseHttpHeaders(),
|
||||
},
|
||||
}
|
||||
);
|
||||
if (resp.data?.email) {
|
||||
return resp.data;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
async function loadCloudFiles() {
|
||||
try {
|
||||
const fileContent = await fs.readFile(path.join(datadir(), 'cloud-files.jsonl'), 'utf-8');
|
||||
@@ -410,4 +426,5 @@ module.exports = {
|
||||
putCloudContent,
|
||||
removeCloudCachedConnection,
|
||||
readCloudTokenHolder,
|
||||
readCloudTestTokenHolder,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user