Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add middleware to redirect to login #280 #288

Merged
merged 1 commit into from
Aug 14, 2023

Conversation

maany
Copy link
Member

@maany maany commented Aug 14, 2023

The limitation with the middleware is that only GET requests can be properly redirected after a successful login Other types of requests cannot be cached in the session because the middleware and the rest of the app use different NextJs runtimes ( edge and node respectively). The session objects in each runtime are independent and cannot share information.

As a result, once a rucio token expires, the user will be redirected to the login page. If the expired token was detected during a GET request, the user will be redirected after login.

In other cases, the user will be redirected to the dashboard.

The limitation with the middleware is that only GET requests
can be properly redirected after a successful login
Other types of requests cannot be cached in the session as the session
object in the middleware is not the same as the one made available
to the rest of the application. This is a bug with IronSession.
@maany maany self-assigned this Aug 14, 2023
@maany maany added this to the 32.0 milestone Aug 14, 2023
@maany maany merged commit 478f161 into rucio:master Aug 14, 2023
7 checks passed
@maany maany deleted the feature-280-middleware branch August 14, 2023 12:41
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.

1 participant