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

Bugfix/flash save session before redirect #52

Conversation

nlsvgtr
Copy link
Contributor

@nlsvgtr nlsvgtr commented May 3, 2022

Description

express-flash messages are not always saved before a page is redirected. If the redirect happens before the session is saved a flash message is not shown.

Some e2e tests require the message to be shown.

Fix this by adding a explicit req.session.save before the redirect.

Issue reference

Fixes e2e tests errors
See also RGBboy/express-flash#13
and jaredhanson/connect-flash#23

Type of change

Bug fix

Documentation

N/A

Tests

Locally and on AMS staging

@nlsvgtr nlsvgtr requested a review from Badmuts May 18, 2022 10:41
Copy link
Contributor

@Badmuts Badmuts left a comment

Choose a reason for hiding this comment

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

LGTM. Misschien zou je ook res.end kunnen patchen zodat deze de session opslaat voordat (indien aanwezig) voordat het request wordt verstuurd.

@nlsvgtr nlsvgtr merged commit ff369ca into openstad:development May 19, 2022
@nlsvgtr nlsvgtr deleted the bugfix/flash-save-session-before-redirect branch May 19, 2022 13:59
@nlsvgtr
Copy link
Contributor Author

nlsvgtr commented May 19, 2022

Leuk idee. Mischien later :)

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.

None yet

2 participants