Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

Pull out common code from both get and post of the recovery handler #2886

Closed
wants to merge 1 commit into from

Conversation

reivilibre
Copy link
Contributor

From #2866 (comment)
It was bugging me to find out why we couldn't do this ... I wanted to witness the errors for myself and think about why it isn't Send+Sync etc.

Then it turned out it's fine.

It's a bit verbose (it's actually more code) but it does mean that we won't accidentally forget to update both checks at the same time, so I am mildly in favour, but happy to hear what you think

@reivilibre reivilibre requested a review from sandhose June 28, 2024 15:02
Copy link

Deploying matrix-authentication-service-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: bf4f517
Status: ✅  Deploy successful!
Preview URL: https://cc09d19f.matrix-authentication-service-docs.pages.dev
Branch Preview URL: https://rei-recovery-common-code.matrix-authentication-service-docs.pages.dev

View logs

Copy link
Member

@sandhose sandhose left a comment

Choose a reason for hiding this comment

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

I'm really not sure about this pattern. I wonder if instead, we should have a common handler, and extract the http::Method and make the form Optional, and diverge depending on those? And then in the router get(views::recovery::finish::handler).post(views::recovery::finish::handler)?

@reivilibre
Copy link
Contributor Author

didn't consider that, that could work

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants