diff --git a/src/server/routes/auth/github/cityjs.get.ts b/src/server/routes/auth/github/vueconf.ts similarity index 88% rename from src/server/routes/auth/github/cityjs.get.ts rename to src/server/routes/auth/github/vueconf.ts index 19efac67..937bd9fe 100644 --- a/src/server/routes/auth/github/cityjs.get.ts +++ b/src/server/routes/auth/github/vueconf.ts @@ -1,5 +1,7 @@ /* eslint-disable camelcase */ +const repo = 'danielroe/nailing-it-vueconf-us-2023' + export default defineEventHandler(async event => { const { code } = getQuery(event) @@ -50,7 +52,7 @@ export default defineEventHandler(async event => { try { const res = await $fetch( - `https://api.github.com/repos/danielroe/nailing-it-cityjs-2023/collaborators/${username}`, + `https://api.github.com/repos/${repo}/collaborators/${username}`, { method: 'PUT', body: { permission: 'push' }, @@ -65,8 +67,5 @@ export default defineEventHandler(async event => { } catch (err) { console.log('could not add collaborator', err) } - return sendRedirect( - event, - 'https://github.com/danielroe/nailing-it-cityjs-2023/invitations' - ) + return sendRedirect(event, `https://github.com/${repo}/invitations`) }) diff --git a/src/server/routes/cityjs.get.ts b/src/server/routes/vueconf.get.ts similarity index 69% rename from src/server/routes/cityjs.get.ts rename to src/server/routes/vueconf.get.ts index 55bba506..d0e3aec0 100644 --- a/src/server/routes/cityjs.get.ts +++ b/src/server/routes/vueconf.get.ts @@ -1,6 +1,6 @@ const redirect = process.dev - ? '&redirect_uri=http://localhost:3000/auth/github/cityjs' - : '&redirect_uri=https://roe.dev/auth/github/cityjs' + ? '&redirect_uri=http://localhost:3000/auth/github/vueconf' + : '&redirect_uri=https://roe.dev/auth/github/vueconf' const config = useRuntimeConfig() const loginURL = `https://github.com/login/oauth/authorize?client_id=${config.public.githubClientId}${redirect}`