Skip to content

Commit 9623554

Browse files
document things
1 parent e085ddc commit 9623554

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

docs/docs/features/permission-syncing.mdx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@ docker run \
2727
ghcr.io/sourcebot-dev/sourcebot:latest
2828
```
2929

30+
<Warning>
31+
Enabling permission syncing on an **existing** deployment may result in errors that look like **"User does not have an OAuth access token..."**. This is because the OAuth access token associated with the user's existing account does not have the correct scopes necessary for permission syncing. To fix, have the user re-authenticate to refresh their access token by either logging out of Sourcebot and logging in again or unlinking and re-linking their account.
32+
</Warning>
33+
3034
## Platform support
3135

3236
We are actively working on supporting more code hosts. If you'd like to see a specific code host supported, please [reach out](https://www.sourcebot.dev/contact).

packages/backend/src/ee/accountPermissionSyncer.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export class AccountPermissionSyncer {
166166

167167
if (account.provider === 'github') {
168168
if (!account.access_token) {
169-
throw new Error(`User '${account.user.email}' does not have an GitHub OAuth access token associated with their GitHub account.`);
169+
throw new Error(`User '${account.user.email}' does not have an GitHub OAuth access token associated with their GitHub account. Please re-authenticate with GitHub to refresh the token.`);
170170
}
171171

172172
// @hack: we don't have a way of identifying specific identity providers in the config file.
@@ -202,7 +202,7 @@ export class AccountPermissionSyncer {
202202
repos.forEach(repo => aggregatedRepoIds.add(repo.id));
203203
} else if (account.provider === 'gitlab') {
204204
if (!account.access_token) {
205-
throw new Error(`User '${account.user.email}' does not have a GitLab OAuth access token associated with their GitLab account.`);
205+
throw new Error(`User '${account.user.email}' does not have a GitLab OAuth access token associated with their GitLab account. Please re-authenticate with GitLab to refresh the token.`);
206206
}
207207

208208
// @hack: we don't have a way of identifying specific identity providers in the config file.

packages/backend/src/gitlab.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,6 @@ export const getProjectsForAuthenticatedUser = async (visibility: 'private' | 'i
324324
export const getOAuthScopesForAuthenticatedUser = async (api: InstanceType<typeof Gitlab>) => {
325325
try {
326326
const response = await api.requester.get('/oauth/token/info');
327-
console.log('response', response);
328327
if (
329328
response &&
330329
typeof response.body === 'object' &&

packages/web/src/app/components/authMethodSelector.tsx

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,10 @@ export const AuthMethodSelector = ({
2929
// Call the optional analytics callback first
3030
onProviderClick?.(provider);
3131

32-
// @nocheckin
3332
signIn(
3433
provider,
3534
{
3635
redirectTo: callbackUrl ?? "/",
37-
},
38-
// @see: https://github.com/nextauthjs/next-auth/issues/2066
39-
// @see: https://openid.net/specs/openid-connect-core-1_0.html#AuthRequest
40-
// @see: https://next-auth.js.org/getting-started/client#additional-parameters
41-
{
42-
prompt: 'consent',
43-
scope: 'read:user user:email repo'
4436
}
4537
);
4638
}, [callbackUrl, onProviderClick]);

0 commit comments

Comments
 (0)