Skip to content

Commit

Permalink
v4.0.5 Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
INSANITY\Inrix authored and INSANITY\Inrix committed Jul 13, 2018
1 parent 7c5aeca commit ea0535c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions float.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const spawn = require('child_process').spawn;
const AdmZip = require('adm-zip');

process.on('uncaughtException', function(err) { // "Nice" Error handling, will obscure unknown errors, remove or comment for full debugging
log(err)
if (err == "TypeError: JSON.parse(...).forEach is not a function") { // If this error
console.log('\u001b[41mERROR> Failed to login please check your login credentials!\u001b[0m') // Then print out what the user should do
} if (err == "ReferenceError: thisChannel is not defined") {
Expand Down Expand Up @@ -266,10 +267,16 @@ function doLogin() { // Login using the users credentials and save the cookies &
return new Promise((resolve, reject) => {
floatRequest.post({
method: 'POST',
json: {username: settings.user, password: settings.password},
url: 'https://www.floatplane.com/api/user/login',
json: {
username: settings.user,
password: settings.password
},
url: 'https://www.floatplane.com/api/auth/login',
headers: {
'accept': 'application/json'
}
}, function (error, resp, body) {
if (resp.headers['set-cookie']) { // If the server returns cookies then we have probably logged in
if (body.user) { // If the server returns a user then we have logged in
console.log('\u001b[32mLogged In!\u001b[0m\n');
settings.cookies.__cfduid = resp.headers['set-cookie'][0]
settings.cookies['sails.sid'] = resp.headers['set-cookie'][1]
Expand Down
Binary file added releases/4.0.5.zip
Binary file not shown.

0 comments on commit ea0535c

Please sign in to comment.