-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Require user logged in for POSTing confirm endpoint #228
Conversation
Hey y'all! A deployment of this PR can be found here: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second glance...
server/routes/auth.ts
Outdated
@@ -70,7 +70,7 @@ export async function reloadAuthentication() { | |||
} | |||
|
|||
// These routes need to be redefined on every instance of a new router | |||
router.post("/confirm", validateAndCacheHostName, postParser, async (request, response) => { | |||
router.post("/confirm", authenticateWithReject, validateAndCacheHostName, postParser, async (request, response) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this middleware is using !request.user.verifiedEmail || !request.user.accountConfirmed
to check if a user is valid, a confirming user will always be rejected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, switched to explicitly validating
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good now. Good catch
* Require user logged in for POSTing confirm endpoint * Don't use middleware to validate user * Version bump
No description provided.