Skip to content
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

Merged
merged 3 commits into from
Jul 25, 2018
Merged

Conversation

ehsanmasdar
Copy link
Member

No description provided.

@hackgbot
Copy link

Hey y'all! A deployment of this PR can be found here:
https://registration-auth-fix.pr.hack.gt

Copy link
Member

@petschekr petschekr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On second glance...

@@ -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) => {
Copy link
Member

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.

Copy link
Member Author

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

Copy link
Member

@petschekr petschekr left a 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

@ehsanmasdar ehsanmasdar merged commit 2e11c01 into master Jul 25, 2018
@ehsanmasdar ehsanmasdar deleted the auth-fix branch July 25, 2018 07:14
rahulrajus pushed a commit that referenced this pull request Jul 22, 2021
* Require user logged in for POSTing confirm endpoint

* Don't use middleware to validate user

* Version bump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants