Skip to content

Commit

Permalink
Remove jose dependency (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluefoxy009 committed Jun 21, 2024
1 parent f98be36 commit e70f42e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ const userIdentifier = 'any unique identifier'
const cacheDir = './' // You can leave this as undefined unless you want to specify a caching directory
const flow = new Authflow(userIdentifier, cacheDir)
// Get a Minecraft Java Edition auth token, then log it
flow.getMinecraftJavaToken().then(console.log)
flow.getMinecraftJavaToken({ fetchProfile: true }).then(console.log)
```

### Expected Response
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,13 @@
"chai": "^4.3.4",
"chai-as-promised": "^7.1.1",
"mocha": "^10.0.0",
"standard": "^17.0.0",
"prismarine-auth": "file:."
"prismarine-auth": "file:.",
"standard": "^17.0.0"
},
"dependencies": {
"@azure/msal-node": "^2.0.2",
"@xboxreplay/xboxlive-auth": "^3.3.3",
"debug": "^4.3.3",
"jose": "^4.1.4",
"node-fetch": "^2.6.1",
"smart-buffer": "^4.1.0",
"uuid-1345": "^1.0.2"
Expand Down
5 changes: 1 addition & 4 deletions src/TokenManagers/XboxTokenManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ const crypto = require('crypto')
const XboxLiveAuth = require('@xboxreplay/xboxlive-auth')
const debug = require('debug')('prismarine-auth')
const { SmartBuffer } = require('smart-buffer')
const { exportJWK } = require('jose')
const fetch = require('node-fetch')

const { Endpoints, xboxLiveErrors } = require('../common/Constants')
Expand All @@ -22,9 +21,7 @@ const checkIfValid = (expires) => {
class XboxTokenManager {
constructor (ecKey, cache) {
this.key = ecKey
exportJWK(ecKey.publicKey).then(jwk => {
this.jwk = { ...jwk, alg: 'ES256', use: 'sig' }
})
this.jwk = { ...ecKey.publicKey.export({ format: 'jwk' }), alg: 'ES256', use: 'sig' }
this.cache = cache

this.headers = { 'Cache-Control': 'no-store, must-revalidate, no-cache', 'x-xbl-contract-version': 1 }
Expand Down

0 comments on commit e70f42e

Please sign in to comment.