SYNC: cloud test - use test login

This commit is contained in:
SPRINX0\prochazka
2025-06-27 10:51:10 +02:00
committed by Diflow
parent 74b78141b4
commit 930b3d4538
4 changed files with 66 additions and 25 deletions

View File

@@ -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,
};