minecraft-auth
Advanced tools
Comparing version 1.0.32 to 1.0.33
@@ -145,3 +145,3 @@ "use strict"; | ||
return __awaiter(this, void 0, void 0, function () { | ||
var _a; | ||
var _a, error, error_description; | ||
return __generator(this, function (_b) { | ||
@@ -167,3 +167,9 @@ switch (_b.label) { | ||
_b.sent(); | ||
r(req.url.split("?code=")[1]); | ||
if (req.url.includes("?code")) | ||
r(req.url.split("?code=")[1]); | ||
if (req.url.includes("?error")) { | ||
error = req.url.split("?error=")[1].split("&")[0]; | ||
error_description = decodeURIComponent(req.url.split("&error_description=")[1]); | ||
j(new AuthenticationError(error, error_description, "")); | ||
} | ||
return [3 /*break*/, 11]; | ||
@@ -170,0 +176,0 @@ case 5: return [4 /*yield*/, res.writeHead(200)]; |
{ | ||
"name": "minecraft-auth", | ||
"version": "1.0.32", | ||
"version": "1.0.33", | ||
"description": "Package to authenticate with minecraft using traditional yggdrasil, new microsoft authentication and non-premium.", | ||
@@ -10,3 +10,3 @@ "main": "dist/index.js", | ||
"build": "tsc", | ||
"npm-publish": "jest && tsc && npm publish" | ||
"prepublishOnly": "jest && tsc" | ||
}, | ||
@@ -13,0 +13,0 @@ "keywords": [ |
@@ -41,3 +41,3 @@ # Minecraft-auth package | ||
let appSecret = "app secret"; | ||
let redirectURL = "http://localhost/auth"; | ||
let redirectURL = "http://localhost:8080/token"; | ||
@@ -44,0 +44,0 @@ minecraftAuth.MicrosoftAuth.setup(appID, appSecret, redirectURL); |
Sorry, the diff of this file is not supported yet
89749
1467