0
0
mirror of https://github.com/louislam/uptime-kuma.git synced 2024-11-24 02:37:28 +01:00

Revert "Auth: Case insensitive login check on username"

This commit is contained in:
Louis Lam 2023-01-01 22:19:00 +08:00 committed by GitHub
parent e88e10cc8e
commit 50711391d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 49 deletions

View File

@ -1,47 +0,0 @@
CREATE TABLE [temp_user](
[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
[username] VARCHAR(255) NOT NULL UNIQUE COLLATE NOCASE,
[password] VARCHAR(255),
[active] BOOLEAN NOT NULL DEFAULT 1,
[timezone] VARCHAR(150),
twofa_secret VARCHAR(64),
twofa_status BOOLEAN default 0 NOT NULL,
twofa_last_token VARCHAR(6)
);
INSERT INTO [temp_user] SELECT
[id],
[username],
[password],
[active],
[timezone],
twofa_secret,
twofa_status,
twofa_last_token
FROM user;
DROP TABLE user;
CREATE TABLE [user](
[id] INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
[username] VARCHAR(255) NOT NULL UNIQUE COLLATE NOCASE,
[password] VARCHAR(255),
[active] BOOLEAN NOT NULL DEFAULT 1,
[timezone] VARCHAR(150),
twofa_secret VARCHAR(64),
twofa_status BOOLEAN default 0 NOT NULL,
twofa_last_token VARCHAR(6)
);
INSERT INTO [user] SELECT
[id],
[username],
[password],
[active],
[timezone],
twofa_secret,
twofa_status,
twofa_last_token
FROM [temp_user];
DROP TABLE [temp_user];

View File

@ -15,7 +15,7 @@ exports.login = async function (username, password) {
return null;
}
let user = await R.findOne("user", " username = ? AND active = 1", [
let user = await R.findOne("user", " username = ? AND active = 1 ", [
username,
]);

View File

@ -66,7 +66,6 @@ class Database {
"patch-add-radius-monitor.sql": true,
"patch-monitor-add-resend-interval.sql": true,
"patch-maintenance-table2.sql": true,
"patch-user-username-case-insensitive.sql": { parents: [ "patch-2fa-invalidate-used-token.sql", "patch-2fa.sql" ] }
};
/**