diff --git a/setupdb.sh b/setupdb.sh index 084d823..bcd69a2 100644 --- a/setupdb.sh +++ b/setupdb.sh @@ -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, diff --git a/spec/spec.md b/spec/spec.md index 3282c04..15fc1ad 100644 --- a/spec/spec.md +++ b/spec/spec.md @@ -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} diff --git a/templates/passwordReset.html b/templates/passwordReset.html new file mode 100644 index 0000000..17ad011 --- /dev/null +++ b/templates/passwordReset.html @@ -0,0 +1,20 @@ + + + + {{> templateIncludes/style.css.html}} + + +

{{freelanceremail}} Password Reset

+
+
+
+ +
+
+ {{> templateIncludes/returnToIndexButton.html.html}} + + + + + + \ No newline at end of file diff --git a/templates/passwordReset_Fulfilment.html b/templates/passwordReset_Fulfilment.html new file mode 100644 index 0000000..32d6d8c --- /dev/null +++ b/templates/passwordReset_Fulfilment.html @@ -0,0 +1,42 @@ + + + + {{> templateIncludes/style.css.html}} + + + {{#RESET_SUCCESS}} +

{{freelanceremail}}: password has been reset

+ {{> templateIncludes/freelancerLoginSignupProfileLogoutInterface.html.html}} + {{/RESET_SUCCESS}} + {{#REGISTRATION_ERROR_QUERY}} +
+ The Password could not be Reset. +
+ {{/REGISTRATION_ERROR_QUERY}} + {{#REGISTRATION_ERROR_CRITICAL}} +
+ The Password could not be Reset: Critical +
+ {{/REGISTRATION_ERROR_CRITICAL}} + {{#PASSWORD_EMPTY}} +
+ No new password has been entered. +
+ {{/PASSWORD_EMPTY}} + {{#PASSWORD_RESET_EXPIRED}} +
+ The password request has expired. +
+ {{/PASSWORD_RESET_EXPIRED}} + {{#PASSWORD_RESET_DOES_NOT_EXIST}} +
+ The password request does not exist. +
+ {{/PASSWORD_RESET_DOES_NOT_EXIST}} + {{> templateIncludes/returnToIndexButton.html.html}} + + + + + + \ No newline at end of file