appsmith icon indicating copy to clipboard operation
appsmith copied to clipboard

fix: Swapped field order in OAuth2 form - Scope now comes before Authorization expires in (#31059)

Open Elphazy opened this issue 3 weeks ago β€’ 1 comments

Description

Fixes #31059

Corrects the field order in the OAuth2 configuration form. Previously, "Authorization expires in" appeared before "Scope", which is backwards. This change swaps them so Scope appears first (as users typically define what access they need before setting expiration time).

What changed:

  • Swapped two fields in the OAuth2 form
  • Scope now appears before Authorization expires in
  • No logic changes - purely UI/UX improvement

Why this matters: The natural workflow for OAuth2 setup is:

  1. Define what access you need (Scope)
  2. Set expiration time (Authorization expires in) This change aligns the form with that logical flow.

File modified: src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx

Summary by CodeRabbit

  • Bug Fixes
    • Improved OAuth2 authentication configuration by ensuring the "Authorization expires in (seconds)" field is consistently available across all OAuth2 authentication methods, eliminating inconsistencies in the form UI.

✏️ Tip: You can customize this high-level summary in your review settings.

Elphazy avatar Dec 09 '25 11:12 Elphazy

Walkthrough

The "Authorization expires in (seconds)" field was relocated from the OAuth2 Authorization Code-specific rendering method to the shared OAuth2 common section, making the field available across all OAuth2 configurations instead of only Authorization Code flow.

Changes

Cohort / File(s) Summary
OAuth2 Field Reorganization
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
Moved expiresIn field from renderOauth2AuthorizationCode to renderOauth2Common, making it universally available for OAuth2 configurations rather than limited to Authorization Code flow

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

Poem

πŸ” Authorization fields take flight,
Grouped together, neat and tight,
The expires_in finds its place,
Where all OAuth2 auth embrace. ✨

Pre-merge checks and finishing touches

βœ… Passed checks (5 passed)
Check name Status Explanation
Title check βœ… Passed The title accurately describes the main UI/UX change: swapping field order in OAuth2 form with Scope appearing before Authorization expires in.
Description check βœ… Passed The description includes the issue reference, clear explanation of the change, rationale, and file modified. It follows the template structure with appropriate motivation and context.
Linked Issues check βœ… Passed The PR directly addresses issue #31059 by moving the expires_in field to appear after the scope field in OAuth2 configuration, aligning authentication fields as requested.
Out of Scope Changes check βœ… Passed All changes are scoped to the OAuth2 form field reordering in the specified file. No extraneous modifications or logic changes are present.
Docstring Coverage βœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • [ ] πŸ“ Generate docstrings
πŸ§ͺ Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

πŸ“œ Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

πŸ“₯ Commits

Reviewing files that changed from the base of the PR and between 7046aeb300bf6cfaf1b027c0746b630edfdce1ea and cdd6a83a06d09c0b1afe5b7da4edeb23b018dd94.

πŸ“’ Files selected for processing (1)
  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
πŸ“š Learning: 2024-07-26T21:12:57.228Z
Learnt from: sneha122
Repo: appsmithorg/appsmith PR: 30012
File: app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx:679-682
Timestamp: 2024-07-26T21:12:57.228Z
Learning: The user `sneha122` has confirmed the resolution of the feedback regarding the redundancy of `|| false` in the `_.get` expression within the `RestAPIDatasourceForm.tsx` file.

Applied to files:

  • app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx
πŸ”‡ Additional comments (1)
app/client/src/pages/Editor/DataSourceEditor/RestAPIDatasourceForm.tsx (1)

686-695: Authorization expiry field correctly moved next to scope in shared OAuth2 section

The new authentication.expiresIn input is wired consistently and now appears immediately after Scope(s) within renderOauth2Common, so all OAuth2 flows see the field in the expected order; this matches the linked issue’s intent without altering data shape or validation behavior.


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.

coderabbitai[bot] avatar Dec 09 '25 11:12 coderabbitai[bot]

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

github-actions[bot] avatar Dec 16 '25 16:12 github-actions[bot]

This PR has been closed because of inactivity.

github-actions[bot] avatar Dec 24 '25 16:12 github-actions[bot]