v1.0.0-beta.5 - Fixed Mojang issue resulting in "Failed to verify username" for specific users.

The Mojang API may randomly return extraneous spaces around the displayName and username fields. Launching the game with these values will result in the aforementioned error. The launcher now trims these values as a precautionary measure.
This commit is contained in:
Daniel Scalzi 2018-08-24 15:17:32 -04:00
parent 29a8f2a345
commit 70b83a6397
No known key found for this signature in database
GPG Key ID: 5CA2F145B63535F9
4 changed files with 6 additions and 6 deletions

View File

@ -318,9 +318,9 @@ exports.addAuthAccount = function(uuid, accessToken, username, displayName){
config.selectedAccount = uuid config.selectedAccount = uuid
config.authenticationDatabase[uuid] = { config.authenticationDatabase[uuid] = {
accessToken, accessToken,
username, username: username.trim(),
uuid, uuid,
displayName displayName: displayName.trim()
} }
return config.authenticationDatabase[uuid] return config.authenticationDatabase[uuid]
} }

View File

@ -252,7 +252,7 @@ class ProcessBuilder {
let val = null let val = null
switch(identifier){ switch(identifier){
case 'auth_player_name': case 'auth_player_name':
val = this.authUser.displayName val = this.authUser.displayName.trim()
break break
case 'version_name': case 'version_name':
//val = versionData.id //val = versionData.id

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.0.0-beta.4", "version": "1.0.0-beta.5",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "westeroscraftlauncher", "name": "westeroscraftlauncher",
"version": "1.0.0-beta.4", "version": "1.0.0-beta.5",
"description": "Custom modded launcher for Westeroscraft", "description": "Custom modded launcher for Westeroscraft",
"productName": "WesterosCraft Launcher", "productName": "WesterosCraft Launcher",
"main": "index.js", "main": "index.js",