# Feature COMMS-482 - Implement token refreshing and reduce token expiration time

Project: Stream Communicator
Status: closed
URL: https://community.openproject.org/work_packages/COMMS-482

## Planning

| Attribute | Value |
| --- | --- |
| Date |  |
| Priority | Medium |
| Target versions | 17.2.0 |
| Sprint |  |
| Backlog bucket |  |
| Votes |  |
| List |  |
| Roadmap |  |
| Relevance |  |

## OPEN POINTS / FEEDBACK

_No work packages_

## Features and Chunks

_No work packages_

## Bugs and other work packages

_No work packages_

## Technical Details

| Attribute | Value |
| --- | --- |
| Module | Modules and project features / Text editor / Real time collaboration |
| Feature Flag |  |
| Requires doc change | No |
| Enterprise plan |  |

## Details

| Attribute | Value |
| --- | --- |
| Pull preview |  |
| Mockups |  |
| Accessibility | No |

## People

| Attribute | Value |
| --- | --- |
| Assignee |  |
| Accountable |  |
| Product manager |  |
| Developers | Kabiru Mwenja |
| Designer |  |
| Ordered by |  |
| Signed off by |  |
| Interest by |  |

## Estimates and progress

| Attribute | Value |
| --- | --- |
| PD (min) |  |
| PD (max) |  |
| Work |  |
| Labor costs |  |

## Description

As part of the implementation of <mention class="mention" data-id="67613" data-type="work_package" data-text="###67613">\#\#\#67613</mention>  we introduced a OAuth token that is used by the BlockNote \<-\> Hocuspocus integration, allowing the YJS provider (which is hocuspocus) to use the OpenProject API on behaf of the user who is using the application.

More context at <https://github.com/opf/openproject/pull/20363#discussion_r2444637129>

The goal of this implementation is to make sure the refresh token is quite short lived and that we implement a mechanism to refresh the token when necessary.

**QA Notes**

  - The user experience on documents should remain the same- i.e. no regressions or interruptions to the document
    
      - Please look out of disconnect/reconnect blips- as this feature refreshes the openproject \<-\> hocuspocus authentication state periodically
    
      - Please also look out for the behaviour when the browser tab is left in the background for a long time, or computer "goes to sleep"
