Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] GitHub authentication #224

Merged
merged 22 commits into from
Mar 25, 2018
Merged

[WIP] GitHub authentication #224

merged 22 commits into from
Mar 25, 2018

Conversation

Rich-Harris
Copy link
Member

This will fix #211. The codebase is in a bad state though, so I'm also tidying some stuff up to make that easier

@@ -0,0 +1,58 @@
<div class='user' on:mouseenter='set({ showMenu: true })' on:mouseleave='set({ showMenu: false })'>
<span>{{$user.displayName}}</span>
Copy link
Member

@Conduitry Conduitry Mar 25, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's possible to have no displayName (I don't have one!) and so this should probably fall back to the username. Right now I'm seeing 'null' here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

huh! fixed

@Conduitry
Copy link
Member

Trying to load the SSR'd http://localhost:3000/guide directly is throwing an exception ReferenceError: store is not defined. The home, repl, and blog pages don't seem to suffer from this.

user: user && {
// strip access token
id: user.id,
name: user.name,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be username: user.username.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yep, you're right — fixed

@Conduitry
Copy link
Member

Saving/updating an existing gist looks like it mostly works, but it does lose README.md, data.json, and meta.json.

@Rich-Harris
Copy link
Member Author

Fixed all those points now, thanks @Conduitry.

Some fairly substantial changes in this PR:

  • You need to be logged in with GitHub to save the REPL as a gist
  • Saving overwrites a gist in place, if you own it. You can also fork a gist
  • You can change the name of a gist
  • Internally, the examples are no longer stored in the repo, but are also gists — we just have a mapping from example slug to gist ID. This simplifies things greatly
  • The REPL has been broken up into smaller components — the codebase is slightly less hairy now
  • Compilation is done in a worker, meaning your keys don't get sticky when you're editing a larger example (e.g. the Hacker News one)

@Rich-Harris Rich-Harris merged commit 015eb86 into master Mar 25, 2018
@Rich-Harris Rich-Harris deleted the github-authentication branch March 25, 2018 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Require users to sign in with GitHub to create gists
2 participants