ReviewOS

also looking at this

stacks/postline

feat: crosspost to LinkedIn and Instagram

#1
Merged chris wants to merge feat/crosspost-linkedin-instagram into main
31 files +2335 -87
app/Actions/Postline/InstagramAuthAction.tsadded+19-0
Changes to app/Actions/Postline/InstagramAuthAction.ts
@@ -0,0 +1,19 @@
1import { Action } from '@stacksjs/actions'
2import { response } from '@stacksjs/router'
3import { instagram } from '../../Services/Social/InstagramService'
4
5export default new Action({
6 name: 'Postline Instagram Auth',
7 description: 'Redirect to Facebook for Instagram publishing consent.',
8 method: 'GET',
9
10 async handle() {
11 try {
12 return response.redirect(instagram.getAuthUrl())
13 }
14 catch (error) {
15 const message = error instanceof Error ? error.message : String(error)
16 return response.redirect(`/accounts?instagram=error&message=${encodeURIComponent(message)}`)
17 }
18 },
19})