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

Fix caching, relyingParty issue #13

Merged
merged 1 commit into from
Aug 16, 2021
Merged

Fix caching, relyingParty issue #13

merged 1 commit into from
Aug 16, 2021

Conversation

extremeheat
Copy link
Member

@extremeheat extremeheat commented Aug 16, 2021

  • require does not work on relative paths, use fs.read
  • properly set default xbl relyingParty

* `require` does not work on relative paths, use fs.read
* properly set default xbl relyingParty
Copy link
Contributor

@kashalls kashalls left a comment

Choose a reason for hiding this comment

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

Thanks for catching that. LGTM.

@@ -10,7 +10,7 @@ class BedrockTokenManager {
constructor (cacheLocation) {
this.cacheLocation = cacheLocation || path.join(__dirname, './bed-cache.json')
try {
this.cache = require(this.cacheLocation)
Copy link

Choose a reason for hiding this comment

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

You could try to get the absolute path to the cache file using path.resolve instead of path.join, that should do it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, but using require has other side effects like caching which is not desirable, and the cause of obscure bugs. This also brings parity with how we write to the cache.

@extremeheat extremeheat mentioned this pull request Aug 16, 2021
2 tasks
@extremeheat extremeheat merged commit 0223a23 into master Aug 16, 2021
@rom1504 rom1504 deleted the docs branch August 17, 2021 10:18
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.

3 participants