Extend TS Usage
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
81a859a8d9
commit
d07cd177b3
@ -7,6 +7,12 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
'extends': 'eslint:recommended',
|
'extends': 'eslint:recommended',
|
||||||
'overrides': [
|
'overrides': [
|
||||||
|
{
|
||||||
|
files: ['**/*.ts','**/*.js'],
|
||||||
|
parser: '@typescript-eslint/parser',
|
||||||
|
plugins: ['@typescript-eslint'],
|
||||||
|
extends: ['plugin:@typescript-eslint/eslint-recommended', 'plugin:@typescript-eslint/recommended']
|
||||||
|
}
|
||||||
],
|
],
|
||||||
'parserOptions': {
|
'parserOptions': {
|
||||||
'ecmaVersion': 'latest'
|
'ecmaVersion': 'latest'
|
||||||
|
@ -5,7 +5,7 @@ const fs = require('fs/promises');
|
|||||||
const minify = require('../utils/minify.utils');
|
const minify = require('../utils/minify.utils');
|
||||||
|
|
||||||
// Checks users registration key against issued keys
|
// Checks users registration key against issued keys
|
||||||
async function isAuthed(uuid) { // Needs testing
|
async function isAuthed(uuid: string) { // Needs testing
|
||||||
const q = {uuid: uuid};
|
const q = {uuid: uuid};
|
||||||
const res = await db.query('users', q);
|
const res = await db.query('users', q);
|
||||||
log.out('authUtils.checkUser: DB Query answer: ' +
|
log.out('authUtils.checkUser: DB Query answer: ' +
|
||||||
@ -16,7 +16,7 @@ async function isAuthed(uuid) { // Needs testing
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Checks whether a registration request key is valid
|
// Checks whether a registration request key is valid
|
||||||
async function checkRequest(key) {
|
async function checkRequest(key: string) {
|
||||||
const collection = 'registrations';
|
const collection = 'registrations';
|
||||||
const query = {uuid: key};
|
const query = {uuid: key};
|
||||||
const res = await db.query(collection, query);
|
const res = await db.query(collection, query);
|
||||||
@ -33,7 +33,7 @@ async function generateKey() { // Needs testing & moving to 'register.utils'
|
|||||||
return crypto.randomUUID();
|
return crypto.randomUUID();
|
||||||
}
|
}
|
||||||
|
|
||||||
async function generateConfirmationEmail(eml, uuid) {
|
async function generateConfirmationEmail(eml: string, uuid: string) {
|
||||||
try {
|
try {
|
||||||
const htmlTpl = await fs.readFile('mail-templates/register.html', 'utf-8');
|
const htmlTpl = await fs.readFile('mail-templates/register.html', 'utf-8');
|
||||||
const htmlStr = htmlTpl.replace(/>>ACCESSCODE<</g, uuid);
|
const htmlStr = htmlTpl.replace(/>>ACCESSCODE<</g, uuid);
|
@ -105,5 +105,11 @@
|
|||||||
/* Completeness */
|
/* Completeness */
|
||||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||||
}
|
},
|
||||||
|
"include": [
|
||||||
|
"./src",
|
||||||
|
"./test",
|
||||||
|
"./*",
|
||||||
|
"./config"
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user