Skip to content

Commit 658b3b5

Browse files
authored
Fix #142 GitHub custom scopes (#163)
Signed-off-by: Piotr Karpala <[email protected]>
1 parent efe93d0 commit 658b3b5

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

app/components/MainComponent.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export default defineNuxtComponent({
149149
apiError.value = '401 Unauthorized access returned by GitHub API - check if your token in the .env (for local runs). Check PAT token and GitHub permissions.';
150150
break;
151151
case 404:
152-
apiError.value = `404 Not Found - is the ${config.public.scope || ''} org:'${config.public.githubOrg || ''} ent:'${config.public.githubEnt || ''}' team:'${config.public.githubTeam}' correct? ${error.message}`;
152+
apiError.value = `404 Not Found - is the ${config.public.scope || ''} org:"${config.public.githubOrg || ''}" ent:"${config.public.githubEnt || ''}" team:"${config.public.githubTeam}" correct? ${error.message}`;
153153
break;
154154
case 500:
155155
apiError.value = `500 Internal Server Error - most likely a bug in the app. Error: ${error.message}`;

server/routes/auth/github.get.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type FetchError from 'ofetch';
22

33
export default defineOAuthGitHubEventHandler({
44
config: {
5+
scope: process.env.NUXT_OAUTH_GITHUB_CLIENT_SCOPE ? process.env.NUXT_OAUTH_GITHUB_CLIENT_SCOPE.split(',') : undefined,
56
},
67
async onSuccess(event, { user, tokens }) {
78
const config = useRuntimeConfig(event);

0 commit comments

Comments
 (0)