diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index fdb9301..f9ba900 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -23,7 +23,6 @@ If your PR requires multiple options, consider splitting it into multiple PRs to --> - [ ] Bugfix (non-breaking change that resolves an issue) -- [ ] New Game - [ ] New Feature (which introduces functionality to an existing game or user interface) - [ ] Breaking Change (fix or feature that disrupts existing functionality) diff --git a/README.md b/README.md index 1b5121a..085a3d0 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ To login to the API create a .env file and write the following ``` email=your_email password=your_password +debug_mode=false ``` Once you have completed that run the following command ``` diff --git a/login.js b/login.js index aea9825..5c43a77 100644 --- a/login.js +++ b/login.js @@ -5,13 +5,16 @@ require('dotenv').config(); var sha1 = require('js-sha1'); // HMAC SHA-1 with Base64 Encoding function hmacSha1Base64(data) { - +if (process.env.debug_mode == 'false') { var hash = sha1.hmac.array('', data); var base_hash = Buffer.from(hash).toString('base64'); // Replace the last character with a comma const modifiedSignature = base_hash.replace(/.$/, ','); return modifiedSignature; +} else { + return data +} } // Function to generate a random string for the device token function generateRandomString(length) { @@ -26,7 +29,11 @@ function generateRandomString(length) { // Load email and password from environment variables const email = process.env.email; const password = hmacSha1Base64(process.env.password); -console.log(password) +if (process.env.debug_mode == 'true') { + console.log('email',process.env.email) + console.log('password',process.env.password) + console.log(password) +} // Check if email and password are defined if (!email || !password) { console.error("Error: Email or password not found in environment variables.");