Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
  • pubsweet pubsweet
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 53
    • Issues 53
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 8
    • Merge requests 8
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • pubsweet
  • pubsweetpubsweet
  • Issues
  • #426

Closed
Open
Created Sep 20, 2018 by Yannis Barlas@yannisMaintainer

[tokens] Refresh token

We need to handle expired tokens and provide new refresh tokens when that happens.

Currently, we can check if the CURRENT_USER query failed, and remove token / redirect to login.

This, however, is problematic:

  • The query is most likely to occur at some high level component. So for the check to be done, the query needs to run.
  • The query needs to be set to never read the cache for getting the current user. If it does read the cache, the app risks returning a current user without validating the token.
  • If the token expires while a user has an open page for a while, tasks can fail without being logged out. For example, if a user is writing a review, and in the meantime the token expires, hitting the "Submit" button will fail, as would any request with an invalid token. However, the current user query is not re-run at that point, and the user will most likely lose their work.
  • There is redundant code that needs to be written to handle these cases.
Assignee
Assign to
Time tracking