-
Notifications
You must be signed in to change notification settings - Fork 338
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
Fix captcha cache control bug #2326
Conversation
@@ -71,9 +71,13 @@ export class Signup extends Component<any, State> { | |||
|
|||
async fetchCaptcha() { | |||
this.setState({ captchaRes: LOADING_REQUEST }); | |||
HttpService.client.setHeaders({ |
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.
It would be helpful to add functionality to the JS client to set headers for individual requests. This time it doesn't matter too much: the signup page should only be visible to unauthenticated users, so we don't have to worry about overwriting the authentication header. However, I can see this making things needlessly difficult down the line.
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.
If its just a few times too, it might be useful to just create either a separate client without headers on demand, or in HTTPService. Adding optional function params to every lemmy-js-client call might be overkill.
Shouldn't this be rather done in the backend, that it should never cache this response. |
If the response is cached meaning it didn't hit the server at all and thus never set the correct answer. This is probably what caused me to fail the captcha so much. In other words the response should never be cached. |
Fix in LemmyNet/lemmy#4381, this commit can be reverted. |
Fixes #2279