diff --git a/site/src/components/inline-svg.html b/site/src/components/inline-svg.html index 99b3a0b9ec..e4dc0e232f 100644 --- a/site/src/components/inline-svg.html +++ b/site/src/components/inline-svg.html @@ -102,4 +102,39 @@ + + + + + + + + + + \ No newline at end of file diff --git a/site/src/routes/auth/me.json.js b/site/src/routes/auth/me.json.js new file mode 100644 index 0000000000..122be622a8 --- /dev/null +++ b/site/src/routes/auth/me.json.js @@ -0,0 +1,9 @@ +export function get(req, res) { + if (!req.session.passport || !req.session.passport.user) { + res.send(null); + return; + } + + const { id, username, displayName, photo } = req.session.passport && req.session.passport.user; + res.send({ id, username, displayName, photo }); +} \ No newline at end of file diff --git a/site/src/routes/gist/[id].js b/site/src/routes/gist/[id].js index 91a362e2aa..e20acac018 100644 --- a/site/src/routes/gist/[id].js +++ b/site/src/routes/gist/[id].js @@ -4,7 +4,15 @@ import { body } from './_utils.js'; export async function get(req, res) { const { id } = req.params; - const r = await fetch(`https://api.github.com/gists/${id}`); + const headers = {}; + const user = req.session.passport && req.session.passport.user; + if (user) { + headers.Authorization = `token ${user.token}`; + } + + const r = await fetch(`https://api.github.com/gists/${id}`, { + headers + }); res.writeHead(r.status, { 'Content-Type': 'application/json' diff --git a/site/src/routes/index.html b/site/src/routes/index.html index 994c961163..f058be3a82 100644 --- a/site/src/routes/index.html +++ b/site/src/routes/index.html @@ -131,7 +131,7 @@
  • -

    No virtual DOM overhead

    +

    No virtual DOM

    Svelte compiles your code to tiny, framework-less vanilla JS — your app starts fast and stays fast

    learn more diff --git a/site/src/routes/repl/_components/AppControls/UserMenu.html b/site/src/routes/repl/_components/AppControls/UserMenu.html index 7bcd8f0645..2fc8a9577e 100644 --- a/site/src/routes/repl/_components/AppControls/UserMenu.html +++ b/site/src/routes/repl/_components/AppControls/UserMenu.html @@ -1,7 +1,7 @@