mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
trial support
This commit is contained in:
@@ -14,6 +14,7 @@ const connections = require('../controllers/connections');
|
||||
const { getAuthProviderFromReq } = require('../auth/authProvider');
|
||||
const { checkLicense, checkLicenseKey } = require('../utility/checkLicense');
|
||||
const storage = require('./storage');
|
||||
const { getAuthProxyUrl } = require('../utility/authProxy');
|
||||
|
||||
const lock = new AsyncLock();
|
||||
|
||||
@@ -163,6 +164,19 @@ module.exports = {
|
||||
}
|
||||
},
|
||||
|
||||
startTrial_meta: true,
|
||||
async startTrial() {
|
||||
try {
|
||||
const resp = await axios.default.post(`${getAuthProxyUrl()}/trial-license`, { type: 'premium-trial', days: 30 });
|
||||
return resp.data;
|
||||
} catch (err) {
|
||||
return {
|
||||
status: 'error',
|
||||
message: err.messa,
|
||||
};
|
||||
}
|
||||
},
|
||||
|
||||
updateSettings_meta: true,
|
||||
async updateSettings(values, req) {
|
||||
if (!hasPermission(`settings/change`, req)) return false;
|
||||
|
||||
Reference in New Issue
Block a user