Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ export default class GitHubInstallationAccessTokenRefresher {
}

async getAccessToken(repositoryNames: string[]): Promise<string> {
if (repositoryNames.length == 0) {
throw new Error("Must provide at least one repository name when creating a GitHub installation access token.")
}
const auth = createAppAuth({
appId: this.config.appId,
clientId: this.config.clientId,
Expand Down
2 changes: 1 addition & 1 deletion src/features/auth/domain/repositoryAccess/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
export { default as CachingRepositoryAccessReader } from "./CachingRepositoryAccessReaderConfig"
export { default as CachingRepositoryAccessReader } from "./CachingRepositoryAccessReader"
export { default as RepositoryRestrictingAccessTokenDataSource } from "./RepositoryRestrictingAccessTokenDataSource"
12 changes: 9 additions & 3 deletions src/features/auth/view/client/GuestAccessTokenInvalidPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ export default function GuestAccessTokenInvalidPage({
organizationName: string
}) {
const {repositories, isLoading, error} = useRepositoryAccess()
const title = "Could not obtain access"
if (isLoading) {
return (
<InvalidSessionPage>
Expand All @@ -20,15 +19,22 @@ export default function GuestAccessTokenInvalidPage({
}
if (error) {
return (
<InvalidSessionPage title={title}>
<InvalidSessionPage title="Could not obtain access">
It was not possible to obtain access to the projects on the <strong>{organizationName}</strong> organization on GitHub.
</InvalidSessionPage>
)
}
if (repositories.length == 0) {
return (
<InvalidSessionPage title="No projects">
Your account does not have access to any projects.
</InvalidSessionPage>
)
}
const repositoryNamesHTML = makeRepositoryNamesHTML(repositories)
const html = `It was not possible to obtain access to all the projects: ${repositoryNamesHTML}.`
return (
<InvalidSessionPage title={title}>
<InvalidSessionPage title="Could not obtain access">
<div dangerouslySetInnerHTML={{ __html: html }} />
</InvalidSessionPage>
)
Expand Down