Skip to content

Conversation

@pierrejeambrun
Copy link
Member

@pierrejeambrun pierrejeambrun commented Mar 10, 2025

The problem is that the router loader query (config) is done before the token handler gets a chance to actually handle the token. (BaseLayout, but the router loader is done before rendering the BaseLayout)

#47487 introduces auth/perm on the config endpoint which will induce a 401 redirection loop.

This moves the token handling to the axios interceptor, this way outside of rendering / loader consideration, the token handler (to retrieve, or save) is always executed before doing a request.

Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

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

Much better than useEffect!

@bbovenzi
Copy link
Contributor

When we add logout. We may want to use an axios interceptor too.

@pierrejeambrun pierrejeambrun force-pushed the aip-38-move-token-handling-to-axios-interceptor branch from 96b5792 to 32bba44 Compare March 10, 2025 15:50
@pierrejeambrun pierrejeambrun merged commit cc70fce into apache:main Mar 10, 2025
60 checks passed
@pierrejeambrun pierrejeambrun deleted the aip-38-move-token-handling-to-axios-interceptor branch March 10, 2025 16:23
@github-project-automation github-project-automation bot moved this from In progress to Done in AIP-38: Modern Web Application Mar 10, 2025
nailo2c pushed a commit to nailo2c/airflow that referenced this pull request Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AIP-38 Modern Web Application area:providers area:UI Related to UI/UX. For Frontend Developers. provider:fab

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

2 participants