simonw / datasette-app-support

Part of https://github.com/simonw/datasette-app
4 stars 2 forks source link

/-/auth-app-user API endpoint #4

Closed simonw closed 3 years ago

simonw commented 3 years ago

Setting cookies from Electron code looks too complicated - I'll go with the simpler mechanism where every new BrowserWindow hits /-/auth-app-user?redirect=/-/plugins which accepts the Authorization: Bearer xxx token from #53 and redirects with the newly set cookie.

Originally posted by @simonw in https://github.com/simonw/datasette-app/issues/37#issuecomment-912879644

simonw commented 3 years ago

I built this to accept {"redirect": "/-/metadata"} in the JSON request body instead, for consistency with the other API endpoints.

Docs here: https://github.com/simonw/datasette-app-support/blob/9f8cebbe3a25396914dfedd9bc4192cb0da6fab5/README.md#-auth-app-user