Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
24 changes: 24 additions & 0 deletions docker-compose-niteshift.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: '3.8'

services:
redis:
image: redis:7-alpine
container_name: sourcebot-redis
ports:
- "6379:6379"
volumes:
- /root/.niteshift/data/redis:/data
restart: unless-stopped

postgres:
image: postgres:16-alpine
container_name: sourcebot-postgres
ports:
- "5432:5432"
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- /root/.niteshift/data/postgres:/var/lib/postgresql/data
restart: unless-stopped
21 changes: 15 additions & 6 deletions packages/web/src/ee/features/permissionSyncing/tokenRefresh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,18 +119,27 @@ export async function refreshOAuthToken(
continue;
}

// Build request body parameters
const bodyParams: Record<string, string> = {
client_id: clientId,
client_secret: clientSecret,
grant_type: 'refresh_token',
refresh_token: refreshToken,
};

// GitLab requires redirect_uri to match the original authorization request
// even when refreshing tokens
if (provider === 'gitlab') {
bodyParams.redirect_uri = `${env.AUTH_URL}/api/auth/callback/gitlab`;
}

const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
'Accept': 'application/json',
},
body: new URLSearchParams({
client_id: clientId,
client_secret: clientSecret,
grant_type: 'refresh_token',
refresh_token: refreshToken,
}),
body: new URLSearchParams(bodyParams),
});
Comment thread
coderabbitai[bot] marked this conversation as resolved.

if (!response.ok) {
Expand Down