Skip to content

Commit f1442b9

Browse files
committed
debug(auth): add decodeURIComponent and more logging for OAuth state
1 parent 49fe8ca commit f1442b9

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

apps/api/src/routes/auth.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,17 +224,20 @@ router.get('/github/connect', async (req: Request, res: Response) => {
224224

225225
router.get('/github/callback', async (req: Request, res: Response) => {
226226
const { code, error, error_description, state } = req.query;
227-
const stateStr = typeof state === 'string' ? state : '';
227+
const stateStr = typeof state === 'string' ? decodeURIComponent(state) : '';
228228
const isDesktop = stateStr.startsWith(DESKTOP_STATE_PREFIX);
229229
const isDesktopConnect = stateStr.startsWith(DESKTOP_CONNECT_STATE_PREFIX);
230230

231231
// Debug logging
232232
console.log('[Auth Debug] OAuth callback received:', {
233233
state: stateStr,
234+
statePrefix: stateStr.substring(0, 20),
235+
DESKTOP_STATE_PREFIX,
234236
isDesktop,
235237
isDesktopConnect,
236238
hasCode: !!code,
237-
hasError: !!error
239+
hasError: !!error,
240+
fullUrl: req.originalUrl
238241
});
239242

240243
if (error) {

packages/openlinear/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "openlinear",
3-
"version": "0.1.20",
3+
"version": "0.1.21",
44
"description": "OpenLinear launcher, installer, and validation utilities",
55
"license": "MIT",
66
"repository": {

0 commit comments

Comments
 (0)