Skip to content

Commit

Permalink
Require user logged in for POSTing confirm endpoint (#228)
Browse files Browse the repository at this point in the history
* Require user logged in for POSTing confirm endpoint

* Don't use middleware to validate user

* Version bump
  • Loading branch information
ehsanmasdar authored Jul 25, 2018
1 parent 7ec4f76 commit 2e11c01
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions server/routes/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,11 @@ export async function reloadAuthentication() {
response.redirect("/login/confirm");
return;
}
if (!request.isAuthenticated() || !user) {
request.flash("error", "Must be logged in");
response.redirect("/login");
return;
}
user.name = name.trim();

let email = request.body.email as string | undefined;
Expand Down

0 comments on commit 2e11c01

Please sign in to comment.