This commit is contained in:
Tben 2023-08-07 15:34:25 +01:00
parent b65aa390be
commit 5aab7d1eb6
3 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,6 @@
{ {
"name": "datasquirel", "name": "datasquirel",
"version": "1.3.0", "version": "1.3.1",
"description": "Cloud-based SQL data management tool", "description": "Cloud-based SQL data management tool",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -9,6 +9,7 @@
* @property {number} social_login - 0 or 1 => is this user a social user(1) or not(0) * @property {number} social_login - 0 or 1 => is this user a social user(1) or not(0)
* @property {string} csrf_k - CSRF key * @property {string} csrf_k - CSRF key
* @property {boolean} logged_in_status - Is user logged in or not * @property {boolean} logged_in_status - Is user logged in or not
* @property {boolean} [date] - Time of session creation
*/ */
module.exports = { DATASQUIREL_LoggedInUser }; module.exports = { DATASQUIREL_LoggedInUser };

View File

@ -152,7 +152,17 @@ async function githubAuth({ key, code, email, database, clientId, clientSecret,
}); });
response.on("end", function () { response.on("end", function () {
resolve(JSON.parse(str)); try {
resolve(JSON.parse(str));
} catch (error) {
console.log(error.message);
resolve({
success: false,
user: null,
msg: "Something went wrong",
});
}
}); });
response.on("error", (err) => { response.on("error", (err) => {