Submit form with redirect hits 2 times #147
Unanswered
nasermirzaei89
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Unfortunately this is a limitation with |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Here I have a login page:
https://github.com/nasermirzaei89/blog/blob/master/templates/login-page.gohtml#L10
and I set messages like error and success in the session, and on rendering page, I render and delete them.
in the login page, when I return error, it shows that as the notification section uses x-sync
https://github.com/nasermirzaei89/blog/blob/master/templates/page-footer.gohtml#L1
but on success, when I set the success message. it calls the page 2 times:

in the picture above, the first call response size is 2.4kb as it has the message rendered, but the second one is 2.3kb because the message renders only once.
So, the login message won't display after redirect.
Is there any suggested solution to it?
Beta Was this translation helpful? Give feedback.
All reactions