Skip to content

Commit d3e4e52

Browse files
committed
username forced to caps in database and when trying to login
relates #37
1 parent 6df8eae commit d3e4e52

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

database/db_build.sql

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ CREATE TABLE svg_shape (
3535
);
3636
-- //login table
3737
INSERT INTO login_details(username, password) VALUES
38-
('Leonie', 'bump'),
39-
('Jan', 'poo666'),
40-
('Francesca', 'ciao'),
41-
('Colette', 'butts'),
42-
('Sam', 'jam');
38+
('LEONIE', 'bump'),
39+
('JAN', 'poo666'),
40+
('FRANCESCA', 'ciao'),
41+
('COLETTE', 'butts'),
42+
('SAM', 'jam');
4343

4444
INSERT INTO svg(name,props,user_id) VALUES
4545
('picasso','{"fill":"pink"}',1),

src/handlers.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ module.exports = {
3232
});
3333
req.on("end", () => {
3434
let dataObject = querystring.parse(data);
35+
let username = dataObject.username.toUpperCase();
3536
queries.getUserQuery(
36-
dataObject.username,
37+
username,
3738
dataObject.password,
3839
(err, result) => {
3940
const user = result.rows[0];

0 commit comments

Comments
 (0)