Compress fonts and fix bug

main
furo 2023-08-02 16:13:05 +02:00
parent 765dc9dcae
commit 567aa5c12d
10 changed files with 22 additions and 15 deletions

View File

@ -1,7 +1,7 @@
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004 Version 2, December 2004
Copyright (C) 2004 Sam Hocevar <sam@hocevar.net> 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. 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.

View File

@ -38,16 +38,16 @@ AUTH.post('/register', async (req, res) => {
if (captchaAge > 600) if (captchaAge > 600)
return(res.send("Invalid captcha!")) return(res.send("Invalid captcha!"))
// Expire the captcha.
delete valid[captcha]
// Does the username match the requirements? // Does the username match the requirements?
if (!(/^\w{2,20}$/.test(username))) if (!(/^\w{2,20}$/.test(username)))
return(res.send("Username does not match the requirements")) 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")) return(res.send("User already exists"))
// Expire the captcha.
delete valid[captcha]
bcrypt.hash(password, 12).then( bcrypt.hash(password, 12).then(
hash => { hash => {
const hexHash = hash2hex(hash) const hexHash = hash2hex(hash)
@ -70,7 +70,7 @@ AUTH.post('/login', async (req, res) => {
if (!username || !password ) if (!username || !password )
return(res.send(`Not entered:${username ? '' : ' username,'}${password ? '' : ' 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) if (!user)
return(res.send("User doesn't exist!")) return(res.send("User doesn't exist!"))
@ -78,7 +78,7 @@ AUTH.post('/login', async (req, res) => {
bcrypt.compare(password, user.qam_pass).then( bcrypt.compare(password, user.qam_pass).then(
async match => { async match => {
if (!match) if (!match)
return res.send("Password's is incorrect!") return res.send("Password is incorrect!")
const bearer = { const bearer = {
name: user.name, name: user.name,
@ -120,7 +120,7 @@ AUTH.post('/changePass', async (req, res) => {
const username = token.name 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) if (!user)
return(res.send("User doesn't exist!")) return(res.send("User doesn't exist!"))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,34 +1,41 @@
@font-face { @font-face {
font-family: 'Manrope XLight'; 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-face {
font-family: 'Manrope Light'; 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-face {
font-family: 'Manrope Regular'; 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-face {
font-family: 'Manrope Medium'; 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-face {
font-family: 'Manrope SemiBold'; 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-face {
font-family: 'Manrope Bold'; 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-face {
font-family: 'Manrope XBold'; 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');
} }