Skip to content
This repository has been archived by the owner on Aug 16, 2023. It is now read-only.

Commit

Permalink
Remove the need to manually enter Client Launcher Token & Fortnite Token
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyris committed Apr 24, 2018
1 parent ff31c6a commit d81d9c2
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,11 @@ const request = require("request-promise");
const EndPoint = require("./tools/endpoint");
const Stats = require("./tools/stats");


const LAUNCHER_AUTHORIZATION = "MzRhMDJjZjhmNDQxNGUyOWIxNTkyMTg3NmRhMzZmOWE6ZGFhZmJjY2M3Mzc3NDUwMzlkZmZlNTNkOTRmYzc2Y2Y=";
const FORTNITE_AUTHORIZATION = "ZWM2ODRiOGM2ODdmNDc5ZmFkZWEzY2IyYWQ4M2Y1YzY6ZTFmMzFjMjExZjI4NDEzMTg2MjYyZDM3YTEzZmM4NGQ";
class FortniteApi {

constructor(credentials, options) {
this.debug = false;
if (options) {
Expand All @@ -13,7 +17,7 @@ class FortniteApi {
if (
credentials &&
credentials.constructor === Array &&
credentials.length == 4
credentials.length == 2
) {
this.debug && console.log("Fortnite-API - Credentials Params OK");
this.credentials = credentials;
Expand Down Expand Up @@ -43,7 +47,7 @@ class FortniteApi {
request({
url: EndPoint.OAUTH_TOKEN,
headers: {
Authorization: "basic " + this.credentials[3]
Authorization: "basic " + LAUNCHER_AUTHORIZATION
},
form: {
grant_type: "refresh_token",
Expand Down Expand Up @@ -81,7 +85,7 @@ class FortniteApi {
request({
url: EndPoint.OAUTH_TOKEN,
headers: {
Authorization: "basic " + this.credentials[2]
Authorization: "basic " + LAUNCHER_AUTHORIZATION
},
form: tokenConfig,
method: "POST",
Expand All @@ -105,7 +109,7 @@ class FortniteApi {
url: EndPoint.OAUTH_TOKEN,
headers: {
Authorization:
"basic " + this.credentials[3]
"basic " + FORTNITE_AUTHORIZATION
},
form: {
grant_type: "exchange_code",
Expand Down

0 comments on commit d81d9c2

Please sign in to comment.