Password Reset spec and Database Table and related templates

This commit is contained in:
Tina_Azure
2023-04-27 00:23:04 +02:00
parent 2ea6c7a48f
commit 9392425794
4 changed files with 78 additions and 0 deletions

View File

@ -57,6 +57,13 @@ sudo -u postgres psql -c "CREATE TABLE cryptoWallets(
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE passwordResetKeys(
freelancerEmail text PRIMARY KEY,
passwordResetKey text UNIQUE,
expiration timestamp
);
" cavecomm
sudo -u postgres psql -c "CREATE TABLE aliasRoutes(
aliasName text PRIMARY KEY,
freelancerID int,

View File

@ -152,6 +152,14 @@ email + password
clears secure cookie and removes session from DB
+++ "/freelancer/signup"
creates user using a name, email and password while creating a salted hash of the password
++++ "/freelancer/login/passwordreset"
Freelancer can request a reset email to be sent to an email
passwordResetKeys
freelancerEmail text
passwordResetKey text
expiration timestamp - the time at which the resetkey is unusable.
### "/freelancer/profile"
Profile page collating freelancer pages.
@ -235,6 +243,7 @@ mandatory:
databaseConnectionString={postgresql://{user}:{password}@{host}:{port}/{database}}
sslCrtPath
sslKeyPath
domain
optional:{default}

View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
{{> templateIncludes/style.css.html}}
</head>
<body>
<h2>{{freelanceremail}} Password Reset</h2>
<br>
<form action="/passwordreset/{{passwordresetkey}}/fulfilment" method="post">
<label for="freelancerpassword">Password: </label> <input type="password" id="freelancerpassword" name="freelancerpassword" value=""><br>
<button type="submit" class="button">Reset Password</button>
</form>
<br>
{{> templateIncludes/returnToIndexButton.html.html}}
</body>
</html>

View File

@ -0,0 +1,42 @@
<!DOCTYPE html>
<html>
<head>
{{> templateIncludes/style.css.html}}
</head>
<body>
{{#RESET_SUCCESS}}
<h2>{{freelanceremail}}: password has been reset</h2>
{{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}}
{{/RESET_SUCCESS}}
{{#REGISTRATION_ERROR_QUERY}}
<div>
The Password could not be Reset.
</div>
{{/REGISTRATION_ERROR_QUERY}}
{{#REGISTRATION_ERROR_CRITICAL}}
<div>
The Password could not be Reset: Critical
</div>
{{/REGISTRATION_ERROR_CRITICAL}}
{{#PASSWORD_EMPTY}}
<div>
No new password has been entered.
</div>
{{/PASSWORD_EMPTY}}
{{#PASSWORD_RESET_EXPIRED}}
<div>
The password request has expired.
</div>
{{/PASSWORD_RESET_EXPIRED}}
{{#PASSWORD_RESET_DOES_NOT_EXIST}}
<div>
The password request does not exist.
</div>
{{/PASSWORD_RESET_DOES_NOT_EXIST}}
{{> templateIncludes/returnToIndexButton.html.html}}
</body>
</html>