feat: write REST API endpoint to generate auth url

This commit is contained in:
Ali BARIN
2024-09-11 15:43:48 +00:00
committed by Faruk AYDIN
parent 2cfd6739ca
commit ace1f84094
6 changed files with 128 additions and 1 deletions

View File

@@ -0,0 +1,14 @@
import { renderObject } from '../../../../helpers/renderer.js';
export default async (request, response) => {
let connection = await request.currentUser
.$relatedQuery('connections')
.findOne({
id: request.params.connectionId,
})
.throwIfNotFound();
connection = await connection.generateAuthUrl();
renderObject(response, connection);
};