Compare commits

..

No commits in common. "567aa5c12d3bd8a3b1841eca131a74736846d3ae" and "fabb2ca60618dbf25448329ff47420b6fafb02c7" have entirely different histories.

11 changed files with 16 additions and 27 deletions

View File

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

@ -7,11 +7,7 @@
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "qwik",
"repository": {
"type": "git",
"url": "https://git.qwik.space/qwik/qwik-account-manager"
},
"author": "",
"license": "ISC",
"dependencies": {
"bcrypt": "^5.0.1",

View File

@ -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 lower(name) = lower($1::text)", [ username ])).rowCount)
if ((await glauth.query("SELECT * FROM users WHERE name = $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 lower(name) = lower($1::text)", [ username ])).rows[0]
const user = (await glauth.query("SELECT * FROM users WHERE name = $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 is incorrect!")
return res.send("Password's 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 lower(name) = lower($1::text)", [ username ])).rows[0]
const user = (await glauth.query("SELECT * FROM users WHERE name = $1::text", [ username ])).rows[0]
if (!user)
return(res.send("User doesn't exist!"))

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,41 +1,34 @@
@font-face {
font-family: 'Manrope XLight';
src: url('/static/Manrope/Manrope-ExtraLight.woff2') format('woff2'),
url('/static/Manrope/Manrope-ExtraLight.ttf') format('truetype');
src: url('/static/Manrope/Manrope-ExtraLight.ttf');
}
@font-face {
font-family: 'Manrope Light';
src: url('/static/Manrope/Manrope-Light.woff2') format('woff2'),
url('/static/Manrope/Manrope-Light.ttf') format('truetype');
src: url('/static/Manrope/Manrope-Light.ttf');
}
@font-face {
font-family: 'Manrope Regular';
src: url('/static/Manrope/Manrope-Regular.woff2') format('woff2'),
url('/static/Manrope/Manrope-Regular.ttf') format('truetype');
src: url('/static/Manrope/Manrope-Regular.ttf');
}
@font-face {
font-family: 'Manrope Medium';
src: url('/static/Manrope/Manrope-Medium.woff2') format('woff2'),
url('/static/Manrope/Manrope-Medium.ttf') format('truetype');
src: url('/static/Manrope/Manrope-Medium.ttf');
}
@font-face {
font-family: 'Manrope SemiBold';
src: url('/static/Manrope/Manrope-SemiBold.woff2') format('woff2'),
url('/static/Manrope/Manrope-SemiBold.ttf') format('truetype');
src: url('/static/Manrope/Manrope-SemiBold.ttf');
}
@font-face {
font-family: 'Manrope Bold';
src: url('/static/Manrope/Manrope-Bold.woff2') format('woff2'),
url('/static/Manrope/Manrope-Bold.ttf') format('truetype');
src: url('/static/Manrope/Manrope-Bold.ttf');
}
@font-face {
font-family: 'Manrope XBold';
src: url('/static/Manrope/Manrope-ExtraBold.woff2') format('woff2'),
url('/static/Manrope/Manrope-ExtraBold.ttf') format('truetype');
src: url('/static/Manrope/Manrope-ExtraBold.ttf');
}