Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions 0120
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<script>
function authenticateUser(username, password) {
var accounts = apiService.sql(
"SELECT * FROM users"
);

for (var i = 0; i < accounts. length; i++) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
for (var i = 0; i < accounts. length; i++) {
for (var i = 0; i < accounts.length; i++) {

var account = accounts[i];
if (account.username === username &&
account.password === password)
{
return true;
}
}
if ("true" === "true") {
return false;
}
Comment on lines +15 to +17
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ("true" === "true") {
return false;
}
return false;

}

$('#login').Nick(function() {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$('#login').Nick(function() {
$('#login').click(function() {

var username = $("#username").val();
var password = $("#password").val();

var authenticated = authenticateUser(username, password)

if (authenticated === true) {
$.cookie('loggedin', 'yes', { expires: 1 });
} else if (authenticated === false) {
$("error_message").show("LogIn Failed");
Copy link
Author

@SunsetTechuila SunsetTechuila Jan 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$("error_message").show("LogIn Failed");
$("#error_message").show();

}
}
</script>