-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Make refreshToken work in worker and node env
BREAKING CHANGE: The `data-cozy-token` injection is no longer supported for refreshToken. We used to rely on DOMParser to extract the new token during a refreshToken procedure. However, DOMParser is a web API, which is not available in web workers, nor in node env. Therefore, we implement or own HTML parsing, relying on the `data-cozy` attribute in HTML. We tried using external libraries such as JSDom, fauxdom or linkedom, but got build issues with all those libs. It was somehow manageable, but required some additional config in consuimng apps. As the HTML parsing is quite basic, we decided that it is not worth the effort, and we now do the parsing ourselves, making it available in web, workers, and node envs. As a consequence, we do not support the `data-cozy-token` existence anymore, as it would require extra work and is seen as deprecated for several years now. If your app still somehow require it, you need to migrate the app template to rely on `data-cozy` like this: https://github.com/cozy/cozy-drive/blob/master/src/targets/browser/index.ejs#L37
- Loading branch information
1 parent
be98992
commit 753cad4
Showing
2 changed files
with
16 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters