test mine login and custom dist urls
This commit is contained in:
parent
30e635a3b9
commit
b5327c71fc
@ -29,14 +29,20 @@ const log = LoggerUtil.getLogger('AuthManager')
|
||||
* @param {string} password The account password.
|
||||
* @returns {Promise.<Object>} Promise which resolves the resolved authenticated account object.
|
||||
*/
|
||||
exports.addMojangAccount = async function(username, password) {
|
||||
exports.addMojangAccount = async function(username, password){
|
||||
try {
|
||||
const response = await MojangRestAPI.authenticate(username, password, ConfigManager.getClientToken())
|
||||
console.log(response)
|
||||
if(response.responseStatus === RestResponseStatus.SUCCESS) {
|
||||
|
||||
const session = response.data
|
||||
console.log(session)
|
||||
session.selectedProfile = {
|
||||
id:'12039109283',
|
||||
acessToken:'asdasdas',
|
||||
clientToken: 'asdasldkjalskdj',
|
||||
}
|
||||
if(session.selectedProfile != null){
|
||||
console.log("here")
|
||||
const ret = ConfigManager.addMojangAuthAccount(session.selectedProfile.id, session.accessToken, username, session.selectedProfile.name)
|
||||
if(ConfigManager.getClientToken() == null){
|
||||
ConfigManager.setClientToken(session.clientToken)
|
||||
@ -77,7 +83,8 @@ const AUTH_MODE = { FULL: 0, MS_REFRESH: 1, MC_REFRESH: 2 }
|
||||
*/
|
||||
async function fullMicrosoftAuthFlow(entryCode, authMode) {
|
||||
try {
|
||||
|
||||
console.error("try auth from ms")
|
||||
return Promise.reject(microsoftErrorDisplayable(MicrosoftErrorCode.UNKNOWN))
|
||||
let accessTokenRaw
|
||||
let accessToken
|
||||
if(authMode !== AUTH_MODE.MC_REFRESH) {
|
||||
|
@ -4,7 +4,11 @@ const ConfigManager = require('./configmanager')
|
||||
|
||||
// Old WesterosCraft url.
|
||||
// exports.REMOTE_DISTRO_URL = 'http://mc.westeroscraft.com/WesterosCraftLauncher/distribution.json'
|
||||
// exports.REMOTE_DISTRO_URL = 'https://skirda-minecraft-distribution.brzezinski.ru/distribution.json'
|
||||
exports.REMOTE_DISTRO_URL = 'https://helios-files.geekcorner.eu.org/distribution.json'
|
||||
// exports.REMOTE_DISTRO_URL = 'http://192.168.88.10:8080/distribution/manifest'
|
||||
// exports.REMOTE_DISTRO_URL = 'http://gregbrzezinski:8080/distribution/manifest'
|
||||
// exports.REMOTE_DISTRO_URL = 'http://localhost:8080/distribution/files/files/distribution.json'
|
||||
|
||||
const api = new DistributionAPI(
|
||||
ConfigManager.getLauncherDirectory(),
|
||||
|
Loading…
Reference in New Issue
Block a user