17 lines
459 B
JavaScript
17 lines
459 B
JavaScript
const msmc = require("msmc")
|
|
const { Authenticator } = require("minecraft-launcher-core")
|
|
|
|
async function getMicrosoftAuth() {
|
|
const authManager = new msmc.Auth("select_account")
|
|
const xboxManager = await authManager.launch("raw")
|
|
const token = await xboxManager.getMinecraft()
|
|
return token.mclc()
|
|
}
|
|
|
|
function getMojangAuth(username, password) {
|
|
return Authenticator.getAuth(username, password)
|
|
}
|
|
|
|
module.exports = {
|
|
getMicrosoftAuth
|
|
} |