Skip to content

Conversation

@ArielLeyva
Copy link
Contributor

@ArielLeyva ArielLeyva commented Sep 14, 2025

Closes #5212

Description

Implements automatic frontend redirection to the login page when the authentication token expires, based on the backend’s token-expiration-time setting.

Checklist

Before submitting your PR, please indicate which issues are either fixed or closed by this PR. See GitHub Help: Closing issues using keywords.

  • I am aware the project is currently in maintenance-only mode. See README
  • I am aware that translations MUST be made through Transifex and that this PR is NOT a translation update
  • I am making a PR against the master branch.
  • I am sure File Browser can be successfully built. See builds and development.

Copy link
Contributor

@ramiresviana ramiresviana left a comment

Choose a reason for hiding this comment

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

Since the logout is happening without user interaction, adding a message to inform the user they’ve been logged out would make the behavior clearer. Also, please ensure the code passes linter checks by running pnpm run lint to avoid errors when this PR is merged.

@ArielLeyva
Copy link
Contributor Author

Since the logout is happening without user interaction, adding a message to inform the user they’ve been logged out would make the behavior clearer. Also, please ensure the code passes linter checks by running pnpm run lint to avoid errors when this PR is merged.

Perfect, I made that change and I had no problems with pnpm running lint.

Copy link
Contributor

@ramiresviana ramiresviana left a comment

Choose a reason for hiding this comment

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

You have to fix the lint warnings

frontend > pnpm run lint

> filebrowser-frontend@3.0.0 lint /home/filebrowser/frontend
> eslint src/


/home/filebrowser/frontend/src/types/user.d.ts
  66:40  warning  Insert `⏎`  prettier/prettier

/home/filebrowser/frontend/src/utils/auth.ts
   27:14  warning  Replace `'inactivity'` with `"inactivity"`  prettier/prettier
  116:7   warning  Insert `·`                                  prettier/prettier
  117:20  warning  Delete `·`                                  prettier/prettier
  118:24  warning  Delete `·`                                  prettier/prettier
  119:43  warning  Insert `,`                                  prettier/prettier
  122:20  warning  Delete `·`                                  prettier/prettier
  125:6   warning  Delete `⏎····`                              prettier/prettier

/home/filebrowser/frontend/src/views/Login.vue
    6:55  warning  Replace `{{t(`login.logout_reasons.${reason}`)}}` with `⏎········{{·t(`login.logout_reasons.${reason}`)·}}⏎······`  prettier/prettier
   74:28  warning  Replace `'logout-reason'` with `"logout-reason"`                                                                    prettier/prettier
  130:10  warning  Insert `⏎`                                                                                                          prettier/prettier

✖ 11 problems (0 errors, 11 warnings)
  0 errors and 11 warnings potentially fixable with the `--fix` option.

@ArielLeyva
Copy link
Contributor Author

You have to fix the lint warnings

frontend > pnpm run lint

> filebrowser-frontend@3.0.0 lint /home/filebrowser/frontend
> eslint src/


/home/filebrowser/frontend/src/types/user.d.ts
  66:40  warning  Insert `⏎`  prettier/prettier

/home/filebrowser/frontend/src/utils/auth.ts
   27:14  warning  Replace `'inactivity'` with `"inactivity"`  prettier/prettier
  116:7   warning  Insert `·`                                  prettier/prettier
  117:20  warning  Delete `·`                                  prettier/prettier
  118:24  warning  Delete `·`                                  prettier/prettier
  119:43  warning  Insert `,`                                  prettier/prettier
  122:20  warning  Delete `·`                                  prettier/prettier
  125:6   warning  Delete `⏎····`                              prettier/prettier

/home/filebrowser/frontend/src/views/Login.vue
    6:55  warning  Replace `{{t(`login.logout_reasons.${reason}`)}}` with `⏎········{{·t(`login.logout_reasons.${reason}`)·}}⏎······`  prettier/prettier
   74:28  warning  Replace `'logout-reason'` with `"logout-reason"`                                                                    prettier/prettier
  130:10  warning  Insert `⏎`                                                                                                          prettier/prettier

✖ 11 problems (0 errors, 11 warnings)
  0 errors and 11 warnings potentially fixable with the `--fix` option.

Code has been reformatted to comply with Prettier's guidelines.
Appreciate your guidance throughout the process—really helped clarify a few things.

Copy link
Member

@hacdias hacdias left a comment

Choose a reason for hiding this comment

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

Thank you both!

@hacdias hacdias merged commit e6c674b into filebrowser:master Sep 19, 2025
8 checks passed
jake-dog added a commit to jake-dog/filebrowser that referenced this pull request Nov 28, 2025
jake-dog added a commit to jake-dog/filebrowser that referenced this pull request Nov 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Session timeout should trigger automatic redirect to login page

3 participants