Skip to content

fix: Move expires_in field after scope in OAuth2 datasource config#41821

Open
YoussefMansour9 wants to merge 2 commits into
appsmithorg:releasefrom
YoussefMansour9:fix/oauth2-expires-in-field
Open

fix: Move expires_in field after scope in OAuth2 datasource config#41821
YoussefMansour9 wants to merge 2 commits into
appsmithorg:releasefrom
YoussefMansour9:fix/oauth2-expires-in-field

Conversation

@YoussefMansour9
Copy link
Copy Markdown

@YoussefMansour9 YoussefMansour9 commented May 17, 2026

Description

Moves the "Authorization expires in (seconds)" field to appear right after the "Scope(s)" field in the OAuth2 datasource configuration form. This groups all authentication-related fields together for better UX.

Changes

  • Moved expiresIn field from renderOauth2AuthorizationCode() to renderOauth2Common()
  • Added conditional check to only display for Authorization Code grant type
  • Field order is now: Scope(s) → Authorization expires in (seconds) → Client Authentication

Fixes #31059

Summary by CodeRabbit

  • Bug Fixes
    • Updated OAuth2 form to conditionally display the "Authorization expires in (seconds)" field when Authorization Code grant type is selected.

Review Change Stack

- Moved Authorization expires in (seconds) field to appear right after Scope(s) field
- Added conditional check to only show for Authorization Code grant type
- This improves UX by grouping all authentication-related fields together

Fixes appsmithorg#31059
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 07c78804-68ec-4a92-9aff-4f2b527f7a30

📥 Commits

Reviewing files that changed from the base of the PR and between 6c8fab7 and 653ae8a.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx

Walkthrough

The expires-in field in the OAuth2 datasource form is reorganized to appear in the shared OAuth2 common section with conditional rendering based on Authorization Code grant type, rather than in the Authorization Code–specific section, centralizing related authentication configuration fields.

Changes

OAuth2 Form Reorganization

Layer / File(s) Summary
Expires-in field conditional rendering
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
Authorization expires-in input moves from Authorization Code–specific UI to shared OAuth2 common section and renders conditionally when authentication.grantType === GrantType.AuthorizationCode.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

🔐 The expires-in field takes flight,

From Authorization Code's sight,

To OAuth2's common embrace,

Conditional, in its rightful place! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: moving the expires_in field after scope in OAuth2 datasource configuration.
Description check ✅ Passed The description includes motivation, specific changes, field ordering, and correctly references the linked issue #31059.
Linked Issues check ✅ Passed Code changes directly address issue #31059 by moving expiresIn field to renderOauth2Common() with proper conditional logic for Authorization Code grant type.
Out of Scope Changes check ✅ Passed All changes in RestAPIDatasourceForm.tsx are scoped to OAuth2 form rendering and directly related to the expires_in field relocation objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Task]: Move expires_in field after scope while configuring oauth2 datasource

1 participant