Skip to content

Commit 68f41ce

Browse files
committed
updates from pr comments
1 parent ef1bf0b commit 68f41ce

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ Below are the available endpoints for each table.
180180
**POST** `/api/rate-limits-combo`
181181

182182
- **Description**: Adds a new rate limit combination entry. Each combination of `ip_address`, `wallet_address`,
183-
and `github_username` is checked for uniqueness before inserting to DB.
183+
and `github_userid` is checked for uniqueness before inserting to DB.
184184
- **Request Body**:
185185
```json
186186
{

src/db/rateLimitsCombo.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
import db from './config.js'; // Import the database configuration
22

3-
const addRateLimitCombo = async (ip_address, wallet_address, github_username) => {
3+
const addRateLimitCombo = async (ip_address, wallet_address, github_userid) => {
44
const query = `
5-
INSERT INTO faucet.rate_limits_combo (ip_address, wallet_address, github_username)
5+
INSERT INTO faucet.rate_limits_combo (ip_address, wallet_address, github_userid)
66
VALUES ($1, $2, $3)
7-
ON CONFLICT (ip_address, wallet_address, github_username) DO NOTHING
7+
ON CONFLICT (ip_address, wallet_address, github_userid) DO NOTHING
88
RETURNING *;
99
`;
10-
const values = [ip_address, wallet_address, github_username];
10+
const values = [ip_address, wallet_address, github_userid];
1111

1212
try {
1313
const result = await db.query(query, values);
1414

1515
if (result.rowCount === 0) {
16-
console.log('Duplicate combination found:', {ip_address, wallet_address, github_username});
16+
console.log('Duplicate combination found:', {ip_address, wallet_address, github_userid});
1717
} else {
1818
console.log('New combo inserted:', result.rows[0]);
1919
}

src/routes/middleware/authorization.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ import { OAuth2Client } from 'google-auth-library';
33
const oAuth2Client = new OAuth2Client();
44

55
const validateGoogleToken = async (req, res, next) => {
6+
if(process.env.POSTGRES_STRING) {
7+
return next();
8+
}
9+
610
const authHeader = req.header('Authorization');
711
if (!authHeader) {
812
return res.status(401).json({ message: 'Unauthorized' });

0 commit comments

Comments
 (0)