Wilsonator123 / Secure-Blog-Page

DSS Projecy
1 stars 0 forks source link

Login functions #55

Closed Sleepy-Git-User closed 4 months ago

Sleepy-Git-User commented 4 months ago

This branch has a fair few changes in it.

ACCOUNT CREATION function added LOGIN function added UUID function added QUERY function remade to be promise based with pre made SQL statements Updated the DDL to have 128 char limit for 'salt' and 'password'

these functions are all the building blocks for all our security for the most part.

14 #53 #19

Sleepy-Git-User commented 4 months ago

As an extra comment I couldnt get the DDL code to work that @Wilsonator123 merged in. Im not 10% sure why so Ive gone down the industry standard of using PGADMIN query tool to set up the database as would be done with a dev environment set up. I ran this series of queries in to PGADMIN query tool. Please note that I also updated the DDL file in the code to reflect this used DDL encase it was just my docker being dumb,

`SET search_path TO public;

CREATE TABLE IF NOT EXISTS "User" ( UserID VARCHAR(128) NOT NULL UNIQUE PRIMARY KEY, Email VARCHAR(320) NOT NULL UNIQUE, Fname TEXT NOT NULL, Lname TEXT NOT NULL, DoB DATE NOT NULL, Email_Confirmed BOOLEAN DEFAULT FALSE NOT NULL, Account_Status BOOLEAN DEFAULT FALSE NOT NULL );

CREATE TABLE IF NOT EXISTS "Password" ( UserID VARCHAR(128) PRIMARY KEY, Password VARCHAR(128) NOT NULL, Salt VARCHAR(128) NOT NULL, FOREIGN KEY (UserID) REFERENCES "User" (UserID) ON DELETE CASCADE );`