You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Because we can't edit gists created by the Playground, I like to copy the content into my own account and add a comment linking back to the Playground e.g., https://gist.github.com/heaths/9ca334d400763698e0d4c895d495190a. This allows us to make some changes after some discussions and makes it easy to share so colleagues can modify the code in the Playground, try things out, look at different output, etc.
As a simplification of #609 the Playground could [prompt the user for authenticating(https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) with the gist scope and call the gist creation API to create a private gist. The user token wouldn't need to be persisted, thus requiring a backend database, HttpOnly cookies, or the sort. Just keep it and the refresh token in memory.
By keeping the refresh token in memory, the Playground could also support updates. If the gist already exists it could be updated, using the refresh token as needed. Similarly, if someone navigates to the Playground with an existing gist ID, the update API could be attempted. If it's not their gist the call would fail so there's no need to check authorization ahead of time.
An OAuth App would need to be created for the Playground.
For the UI, I was thinking of a drop-down button like some of the other existing ones. The default would be the existing behavior so no one is surprised, but in a drop-down you could have something like "Save to account".
The text was updated successfully, but these errors were encountered:
Because we can't edit gists created by the Playground, I like to copy the content into my own account and add a comment linking back to the Playground e.g., https://gist.github.com/heaths/9ca334d400763698e0d4c895d495190a. This allows us to make some changes after some discussions and makes it easy to share so colleagues can modify the code in the Playground, try things out, look at different output, etc.
As a simplification of #609 the Playground could [prompt the user for authenticating(https://docs.github.com/apps/creating-github-apps/authenticating-with-a-github-app/generating-a-user-access-token-for-a-github-app) with the
gist
scope and call the gist creation API to create a private gist. The user token wouldn't need to be persisted, thus requiring a backend database,HttpOnly
cookies, or the sort. Just keep it and the refresh token in memory.Additionally, a comment could be added back to the Playground e.g., https://gist.github.com/heaths/9ca334d400763698e0d4c895d495190a?permalink_comment_id=5263599#gistcomment-5263599 (just the first bullet as a single line comment).
By keeping the refresh token in memory, the Playground could also support updates. If the gist already exists it could be updated, using the refresh token as needed. Similarly, if someone navigates to the Playground with an existing gist ID, the update API could be attempted. If it's not their gist the call would fail so there's no need to check authorization ahead of time.
An OAuth App would need to be created for the Playground.
For the UI, I was thinking of a drop-down button like some of the other existing ones. The default would be the existing behavior so no one is surprised, but in a drop-down you could have something like "Save to account".
The text was updated successfully, but these errors were encountered: