also looking at this
feat: crosspost to LinkedIn and Instagram
#1
31 files
+2335
-87
| @@ -0,0 +1,19 @@ | ||
| 1 | import { Action } from '@stacksjs/actions' | |
| 2 | import { response } from '@stacksjs/router' | |
| 3 | import { instagram } from '../../Services/Social/InstagramService' | |
| 4 | ||
| 5 | export 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 | }) | |