Skip to content

Conversation

jescalada
Copy link
Contributor

Fixes #1091.

This PR adds a Settings page that allows configuring the JWT token to authenticate UI requests to the API:

image

Previously, requests were bypassing the JWT check if they came from an authenticated user, and being completely blocked when not logged in.

This PR also improves the error messages shown when JWT authentication fails:

Missing token

image

Bad JWT format

image

Expired JWT

image

Copy link

netlify bot commented Jul 9, 2025

Deploy Preview for endearing-brigadeiros-63f9d0 canceled.

Name Link
🔨 Latest commit 551e237
🔍 Latest deploy log https://app.netlify.com/projects/endearing-brigadeiros-63f9d0/deploys/68a7fe764808b0000880b72f

Copy link

codecov bot commented Jul 9, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 82.83%. Comparing base (d9d8b18) to head (551e237).
⚠️ Report is 23 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1096      +/-   ##
==========================================
+ Coverage   82.80%   82.83%   +0.02%     
==========================================
  Files          66       66              
  Lines        2786     2784       -2     
  Branches      334      334              
==========================================
- Hits         2307     2306       -1     
+ Misses        432      431       -1     
  Partials       47       47              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jescalada jescalada linked an issue Jul 9, 2025 that may be closed by this pull request
@JamieSlome
Copy link
Member

@jescalada - thanks for the PR ❤️

Perhaps it makes sense to display the error message outside of the table in a pop-up? Open until closed by the user?

@jescalada
Copy link
Contributor Author

I modified this so that it uses one of the predefined error components (and got the message out of the tabs box):

image

There's still an issue with a non-descriptive error when JWT is enabled but the config is missing.

@jescalada
Copy link
Contributor Author

jescalada commented Jul 10, 2025

I've tried to find better-looking error displays (such as custom-styled Snackbars, and other components), but it seems MUI v4 doesn't support some of the best ones.

In later versions of MUI we can use these Alert components or combine them with Snackbars to make it look better.

There's this issue for upgrading MUI to v5 #1023 which I'll take a look at soon. It might be worth modernizing the frontend a bit once the dependency upgrades are done. (Note: Upgrading directly to v7 is not possible as each new major version introduces various breaking changes - plus the automatic migration tools only go up one major version at a time)

Copy link
Contributor

@dcoric dcoric left a comment

Choose a reason for hiding this comment

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

This looks great! Thanks for putting this together. 🚀

I've left a few small nitpicks for your consideration. The main one is just removing the console.log from getAxiosConfig to keep our output clean.

Once that's sorted, this is good to go!

@jescalada jescalada merged commit ef79ca4 into finos:main Aug 22, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement JWT API authorization support for UI Implement JWT API authorization support for UI
3 participants