generated from gitcommitshow/github-app-boilerplate
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: admin access to download data (#39)
- Loading branch information
1 parent
e50a0f3
commit 5d0aecc
Showing
8 changed files
with
152 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const loginAttempts = {}; | ||
|
||
export function isPasswordValid(username, password){ | ||
// Check if user has exceeded max attempts | ||
if (loginAttempts[username] >= 3) { | ||
console.error("Account locked! Too many attempts.") | ||
return false | ||
} | ||
// Check credentials | ||
if (process.env.LOGIN_USER === username && process.env.LOGIN_PASSWORD === password) { | ||
// Successful login | ||
loginAttempts[username] = 0; // Reset attempts on successful login | ||
return true | ||
} | ||
loginAttempts[username] = (loginAttempts[username] || 0) + 1; | ||
return false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<title>RudderStack Open Source Contributor Dashboard</title> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/water.css@2/out/light.css"> | ||
<style> | ||
body { | ||
background-color: #F6F5F3; | ||
} | ||
a { | ||
text-decoration: none; | ||
color: "#105ED5"; | ||
} | ||
a:visited { | ||
color: "#ADC9FF"; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container"> | ||
<h2>⬇️ Download Center</h2> | ||
<p> | ||
<br/> | ||
Contact admin for more details | ||
<br/><br/><br/> | ||
<form action="/download" method="post"> | ||
<label for="username">Username:</label> | ||
<input type="text" id="username" name="username" required><br><br> | ||
<label for="password">Password:</label> | ||
<input type="password" id="password" name="password" required><br><br> | ||
<label for="format">Format:</label> | ||
<select id="format" name="format"> | ||
<option value="csv">CSV</option> | ||
<option value="json">JSON</option> | ||
</select><br><br> | ||
<input type="submit" value="Download"> | ||
</form> | ||
<br/><br/><br/><br/><br/> | ||
<hr/> | ||
<ul> | ||
<li><a href="/">Home</a></li> | ||
</ul> | ||
</p> | ||
</div> | ||
</body> | ||
</html> |