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 DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004 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. 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": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },
"author": "qwik", "author": "",
"repository": {
"type": "git",
"url": "https://git.qwik.space/qwik/qwik-account-manager"
},
"license": "ISC", "license": "ISC",
"dependencies": { "dependencies": {
"bcrypt": "^5.0.1", "bcrypt": "^5.0.1",

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 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")) 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 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) 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 is incorrect!") return res.send("Password's 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 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) 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.

View File

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