feat: Implement rest API endpoint to verify connection

This commit is contained in:
Faruk AYDIN
2024-08-27 14:48:12 +03:00
parent 77246c1fde
commit 1a833aad52
6 changed files with 120 additions and 1 deletions

View File

@@ -171,6 +171,17 @@ class Connection extends Base {
});
}
async verifyAndUpdateConnection() {
const app = await this.getApp();
const $ = await globalVariable({ connection: this, app });
await app.auth.verifyCredentials($);
return await this.$query().patchAndFetch({
verified: true,
draft: false,
});
}
async verifyWebhook(request) {
if (!this.key) return true;