diff --git a/LICENSE b/LICENSE index 7a3094a..3d06058 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 -Copyright (C) 2004 Sam Hocevar +Copyright (C) 2023 qwik Everyone is permitted to copy and distribute verbatim or modified copies of this license document, and changing it is allowed as long as the name is changed. diff --git a/routes/auth.js b/routes/auth.js index 637bac4..d85d8a4 100644 --- a/routes/auth.js +++ b/routes/auth.js @@ -38,16 +38,16 @@ AUTH.post('/register', async (req, res) => { if (captchaAge > 600) return(res.send("Invalid captcha!")) - // Expire the captcha. - delete valid[captcha] - // Does the username match the requirements? if (!(/^\w{2,20}$/.test(username))) return(res.send("Username does not match the requirements")) - if ((await glauth.query("SELECT * FROM users WHERE name = $1::text", [ username ])).rowCount) + if ((await glauth.query("SELECT * FROM users WHERE lower(name) = lower($1::text)", [ username ])).rowCount) return(res.send("User already exists")) + // Expire the captcha. + delete valid[captcha] + bcrypt.hash(password, 12).then( hash => { const hexHash = hash2hex(hash) @@ -70,7 +70,7 @@ AUTH.post('/login', async (req, res) => { if (!username || !password ) return(res.send(`Not entered:${username ? '' : ' username,'}${password ? '' : ' password'}`)) - const user = (await glauth.query("SELECT * FROM users WHERE name = $1::text", [ username ])).rows[0] + const user = (await glauth.query("SELECT * FROM users WHERE lower(name) = lower($1::text)", [ username ])).rows[0] if (!user) return(res.send("User doesn't exist!")) @@ -78,7 +78,7 @@ AUTH.post('/login', async (req, res) => { bcrypt.compare(password, user.qam_pass).then( async match => { if (!match) - return res.send("Password's is incorrect!") + return res.send("Password is incorrect!") const bearer = { name: user.name, @@ -120,7 +120,7 @@ AUTH.post('/changePass', async (req, res) => { const username = token.name - const user = (await glauth.query("SELECT * FROM users WHERE name = $1::text", [ username ])).rows[0] + const user = (await glauth.query("SELECT * FROM users WHERE lower(name) = lower($1::text)", [ username ])).rows[0] if (!user) return(res.send("User doesn't exist!")) diff --git a/static/Manrope/Manrope-Bold.woff2 b/static/Manrope/Manrope-Bold.woff2 new file mode 100644 index 0000000..96ab868 Binary files /dev/null and b/static/Manrope/Manrope-Bold.woff2 differ diff --git a/static/Manrope/Manrope-ExtraBold.woff2 b/static/Manrope/Manrope-ExtraBold.woff2 new file mode 100644 index 0000000..033cbcf Binary files /dev/null and b/static/Manrope/Manrope-ExtraBold.woff2 differ diff --git a/static/Manrope/Manrope-ExtraLight.woff2 b/static/Manrope/Manrope-ExtraLight.woff2 new file mode 100644 index 0000000..5eb0ef3 Binary files /dev/null and b/static/Manrope/Manrope-ExtraLight.woff2 differ diff --git a/static/Manrope/Manrope-Light.woff2 b/static/Manrope/Manrope-Light.woff2 new file mode 100644 index 0000000..3b1a23d Binary files /dev/null and b/static/Manrope/Manrope-Light.woff2 differ diff --git a/static/Manrope/Manrope-Medium.woff2 b/static/Manrope/Manrope-Medium.woff2 new file mode 100644 index 0000000..09d520d Binary files /dev/null and b/static/Manrope/Manrope-Medium.woff2 differ diff --git a/static/Manrope/Manrope-Regular.woff2 b/static/Manrope/Manrope-Regular.woff2 new file mode 100644 index 0000000..017f162 Binary files /dev/null and b/static/Manrope/Manrope-Regular.woff2 differ diff --git a/static/Manrope/Manrope-SemiBold.woff2 b/static/Manrope/Manrope-SemiBold.woff2 new file mode 100644 index 0000000..a8335ee Binary files /dev/null and b/static/Manrope/Manrope-SemiBold.woff2 differ diff --git a/static/css/fonts.css b/static/css/fonts.css index f773204..bbd73dc 100644 --- a/static/css/fonts.css +++ b/static/css/fonts.css @@ -1,34 +1,41 @@ @font-face { font-family: 'Manrope XLight'; - src: url('/static/Manrope/Manrope-ExtraLight.ttf'); + src: url('/static/Manrope/Manrope-ExtraLight.woff2') format('woff2'), + url('/static/Manrope/Manrope-ExtraLight.ttf') format('truetype'); } @font-face { font-family: 'Manrope Light'; - src: url('/static/Manrope/Manrope-Light.ttf'); + src: url('/static/Manrope/Manrope-Light.woff2') format('woff2'), + url('/static/Manrope/Manrope-Light.ttf') format('truetype'); } @font-face { font-family: 'Manrope Regular'; - src: url('/static/Manrope/Manrope-Regular.ttf'); + src: url('/static/Manrope/Manrope-Regular.woff2') format('woff2'), + url('/static/Manrope/Manrope-Regular.ttf') format('truetype'); } @font-face { font-family: 'Manrope Medium'; - src: url('/static/Manrope/Manrope-Medium.ttf'); + src: url('/static/Manrope/Manrope-Medium.woff2') format('woff2'), + url('/static/Manrope/Manrope-Medium.ttf') format('truetype'); } @font-face { font-family: 'Manrope SemiBold'; - src: url('/static/Manrope/Manrope-SemiBold.ttf'); + src: url('/static/Manrope/Manrope-SemiBold.woff2') format('woff2'), + url('/static/Manrope/Manrope-SemiBold.ttf') format('truetype'); } @font-face { font-family: 'Manrope Bold'; - src: url('/static/Manrope/Manrope-Bold.ttf'); + src: url('/static/Manrope/Manrope-Bold.woff2') format('woff2'), + url('/static/Manrope/Manrope-Bold.ttf') format('truetype'); } @font-face { font-family: 'Manrope XBold'; - src: url('/static/Manrope/Manrope-ExtraBold.ttf'); + src: url('/static/Manrope/Manrope-ExtraBold.woff2') format('woff2'), + url('/static/Manrope/Manrope-ExtraBold.ttf') format('truetype'); } \ No newline at end of file