Compare commits

...

2 Commits

Author SHA1 Message Date
Fred Boniface 588efcad3d Random notes
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-09-10 21:35:18 +01:00
Fred Boniface 48b9d65c1d Update registration emai ltemplate
Signed-off-by: Fred Boniface <fred@fjla.uk>
2023-09-10 21:30:57 +01:00
2 changed files with 4 additions and 2 deletions

View File

@ -63,6 +63,7 @@
id="button"
>Register</a
>
<br />
<img
src="https://barcodes.fjla.uk/generate?type=aztec&text=https%3A%2F%2Fowlboard.info%2Fmore%2Freg%2Fsubmit%3Fkey%3D>>ACCESSCODE<<"
alt="Scan barcode to register on another device"

View File

@ -22,10 +22,11 @@ async function isAuthed(uuid: string): Promise<boolean> {
}
// Checks whether a registration request key is valid
async function checkRequest(key: string) {
async function checkRequest(key: string) { // For some reason db.query seems to return correctly, but the second logs.out statement prints []??? so registration fails!!
const collection = "registrations";
const query = { uuid: key };
const res = await db.query(collection, query);
logs.out("authUtils.checkRequest: Raw Result: " + res, "dbug")
logs.out(
"authUtils.checkRequest: DB Query result: " + JSON.stringify(res),
"dbug"
@ -39,7 +40,7 @@ async function checkRequest(key: string) {
// Creates an API key for a user
async function generateKey() {
// Needs testing & moving to 'register.utils'
// Needs testing & moving to 'register.utils' ??? Why does it need moving?
return crypt.randomUUID();
}