Skip to content

fix(client): move expires_in field after scope in OAuth2 configuratio…#42017

Open
SaifuddinM23 wants to merge 1 commit into
appsmithorg:releasefrom
SaifuddinM23:fix/31059-move-expires-in-after-scope
Open

fix(client): move expires_in field after scope in OAuth2 configuratio…#42017
SaifuddinM23 wants to merge 1 commit into
appsmithorg:releasefrom
SaifuddinM23:fix/31059-move-expires-in-after-scope

Conversation

@SaifuddinM23

@SaifuddinM23 SaifuddinM23 commented Jul 18, 2026

Copy link
Copy Markdown

Description

TL;DR: Moves the OAuth2 expires_in ("Authorization expires in") input field so that it renders directly below the Scope(s) input field in the Rest API Datasource form.

Motivation & Context: Currently, the expires_in field is placed far down at the end of the authorization code section. Shifting it directly underneath the Scope(s) field keeps all related OAuth2 configuration parameters grouped together, making it much more logical and discoverable for users.

Fixes #31059

Automation

/ok-to-test tags=""

Communication

Should the DevRel and Marketing teams inform users about this change?

  • Yes
  • No

Summary by CodeRabbit

  • Bug Fixes
    • Standardized the OAuth2 “Authorization expires in (seconds)” field so it’s displayed consistently with the shared OAuth2 settings.
    • The field no longer appears only in the Authorization Code section; it’s now conditionally shown alongside other common OAuth2 inputs.

@SaifuddinM23
SaifuddinM23 requested a review from a team as a code owner July 18, 2026 16:33
@coderabbitai

coderabbitai Bot commented Jul 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

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: d3820733-c6cf-4df6-80e9-6e90f49c09e7

📥 Commits

Reviewing files that changed from the base of the PR and between b05dbb0 and c51546d.

📒 Files selected for processing (1)
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
🚧 Files skipped from review as they are similar to previous changes (1)
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx

Walkthrough

The OAuth2 authentication.expiresIn input now renders with shared OAuth2 fields for Authorization Code grants rather than within the Authorization Code-specific section.

Changes

OAuth2 datasource form

Layer / File(s) Summary
Move expiresIn to shared OAuth2 fields
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
The numeric authentication.expiresIn input is conditionally added to common OAuth2 fields and removed from the Authorization Code section.

Estimated code review effort: 2 (Simple) | ~10 minutes

Poem

OAuth fields align in a row,
ExpiresIn finds its place to show.
Shared fields hold the time,
Authorization Code stays fine,
A tidier form begins to glow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly states the main change: moving the OAuth2 expires_in field after Scope.
Description check ✅ Passed The description includes the change summary, motivation, issue link, automation, and communication sections.
Linked Issues check ✅ Passed The change matches #31059 by moving expires_in directly after Scope in the OAuth2 datasource form.
Out of Scope Changes check ✅ Passed The PR appears scoped to the requested OAuth2 field reordering with no unrelated changes.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ 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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx`:
- Around line 686-695: Conditionally render the authentication.expiresIn control
in renderOauth2Common only for the AuthorizationCode grant, matching the
existing RestAPIForm type and formToDatasourceAuthentication behavior. Keep it
hidden for ClientCredentials so entered values cannot be silently discarded; do
not modify the transformer or Oauth2Common types unless intentionally supporting
the field for both grants.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 0f05b388-e3d2-4d55-b7e6-bef234fde903

📥 Commits

Reviewing files that changed from the base of the PR and between 098e536 and b05dbb0.

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

Comment thread app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx Outdated
@TheJhyeFactor

Copy link
Copy Markdown

Hey @SaifuddinM23, I ran this locally and added focused Jest coverage for the field order and the Client Credentials guard: SaifuddinM23#1

The full client suite passed in memory-safe groups: 528 suites, 4,143 tests, and 19 snapshots. Prettier, lint, TypeScript, Husky, and gitleaks are clean too. Once you merge that follow-up, this should meet Appsmith's client-test requirement and be ready for /ok-to-test.

One small thing: the current PR title ends with an ellipsis on GitHub. I'd update it to fix(client): move expires_in field after scope in OAuth2 configuration form before review.

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

2 participants