feat: Implement Desktop OAuth Support #15
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR implements Desktop OAuth Support for the Agentage platform, allowing desktop applications to authenticate users via web-based OAuth with localhost callback.
Changes
Backend
OAuth Routes ()
desktop=true- enables desktop authentication flowcallback- localhost callback URL for redirectinclude_provider_token=true- includes provider access token in responseOAuth Callbacks ()
github_token,google_token, ormicrosoft_token)OAuth Service ()
req.user.providerTokenfor callback useType Definitions ()
providerToken?: stringto Express.User interfaceFrontend
Desktop Login Page ()
/desktop-loginroutecallbackquery parameter (defaults tohttp://localhost:3739/callback)How It Works
https://agentage.io/desktop-login?callback=http://localhost:3739/callback/api/auth/github?desktop=true&callback=http://localhost:3739/callback&include_provider_token=truehttp://localhost:3739/callback?token=JWT&github_token=PROVIDER_TOKENSecurity
Testing
All verification commands passed:
npm run type-check- TypeScript compilation successfulnpm run lint- No new linting errorsnpm run test- All tests passingnpm run build- Production build successfulRelated
specs/desktop-oauth.mdspecs/auth.mdstatus to ✅ ImplementedFiles Changed
packages/backend/src/routes/auth/index.ts(+206, -17)packages/backend/src/services/oauth/oauth.service.ts(+30, -4)packages/backend/src/types/express.d.ts(+3)packages/frontend/src/app/desktop-login/page.tsx(+116, new file)Total: 4 files changed, 334 insertions(+), 21 deletions(-)