Skip to content

fix(datasource): move expiresIn after Scope in OAuth2 form (closes #31059)#41750

Open
Mrsandeep27 wants to merge 1 commit intoappsmithorg:releasefrom
Mrsandeep27:fix/oauth2-expires-in-order
Open

fix(datasource): move expiresIn after Scope in OAuth2 form (closes #31059)#41750
Mrsandeep27 wants to merge 1 commit intoappsmithorg:releasefrom
Mrsandeep27:fix/oauth2-expires-in-order

Conversation

@Mrsandeep27
Copy link
Copy Markdown

@Mrsandeep27 Mrsandeep27 commented Apr 19, 2026

Summary

Closes #31059.

Moves the Authorization expires in (seconds) input in the OAuth2 Authorization Code datasource form so it renders directly after the common OAuth2 fields (which ends with Scope(s)), keeping all authentication-related inputs grouped together as requested in the issue.

Before vs after

Only touches RestAPIDatasourceForm.tsx -> renderOauth2AuthorizationCode(). The order changes from:

  1. Common (client id/secret, scope, client auth method)
  2. Authorization URL
  3. Redirect URL (read-only)
  4. Custom Authentication Parameters
  5. Authorization expires in (seconds)
  6. Advanced (conditional)

to:

  1. Common (client id/secret, scope, client auth method)
  2. Authorization expires in (seconds) ← moved here
  3. Authorization URL
  4. Redirect URL (read-only)
  5. Custom Authentication Parameters
  6. Advanced (conditional)

expiresIn is intentionally kept inside renderOauth2AuthorizationCode (not renderOauth2Common) so it does not show up for the Client Credentials grant type, matching the current behavior.

Test plan

  • Settings → Datasources → Create → Authenticated API → Authentication type: OAuth 2.0 → Grant type: Authorization Code — verify Authorization expires in (seconds) now appears immediately after Scope(s) / Client Authentication.
  • Switch grant type to Client Credentials — the expiresIn field is still hidden (unchanged behaviour).
  • Save a datasource, reload, confirm the stored authentication.expiresIn value is preserved.
  • No lint / TS errors in app/client.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Refactor
    • Reorganized form field layout in the REST API datasource authentication settings for improved clarity.

Relocates the 'Authorization expires in (seconds)' input in the
Authorization Code OAuth2 datasource form so it renders immediately after
the shared OAuth2 common fields (which ends with Scope), grouping all
authentication-related inputs together and improving discoverability.

Closes appsmithorg#31059

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 19, 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: ec44ce8b-d735-4bf9-b4db-059d561500c8

📥 Commits

Reviewing files that changed from the base of the PR and between 2b9ece6 and 20c3831.

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

Walkthrough

Reorders the authentication.expiresIn input field within the OAuth2 authorization code form in RestAPIDatasourceForm, moving it from the end of renderOauth2AuthorizationCode() to immediately after this.renderOauth2Common() for improved field adjacency and discoverability.

Changes

Cohort / File(s) Summary
OAuth2 Field Reordering
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
Repositioned the "Authorization expires in" input field to appear right after common OAuth2 fields, grouping related authentication configuration options together.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

OAuth fields now sit just right, 🎪
Grouped together, clean and tight,
Users scan with newfound ease,
Form discovery that will please! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the primary change: moving the expiresIn field after Scope in the OAuth2 Authorization Code form and references the closed issue.
Description check ✅ Passed The description covers the change clearly with before/after ordering, explains why expiresIn stays in the specific render function, and includes a comprehensive test plan aligned with the issue requirements.
Linked Issues check ✅ Passed The code change fulfills issue #31059 by moving the expiresIn field to render immediately after the common OAuth2 fields (ending with Scope), grouping authentication inputs together as requested.
Out of Scope Changes check ✅ Passed The change is scoped exclusively to moving expiresIn within renderOauth2AuthorizationCode(); no other authentication fields, conditions, or unrelated code modifications are present.
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.

@github-actions
Copy link
Copy Markdown

This PR has not seen activitiy for a while. It will be closed in 7 days unless further activity is detected.

@github-actions github-actions Bot added the Stale label Apr 28, 2026
@Mrsandeep27
Copy link
Copy Markdown
Author

This fix is still relevant and the PR is ready to merge. Happy to rebase on latest main if needed — just let me know!

@github-actions github-actions Bot removed the Stale label May 2, 2026
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