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

fix(seed): CRSF and token issues #2613

Merged
merged 1 commit into from
Aug 10, 2017
Merged

Conversation

daraosn
Copy link
Contributor

@daraosn daraosn commented Jul 27, 2017

When express.static() is serving index.html it breaks the middleware chain and avoids the CRSF to be set on / request, causing the first login to fail, whenever users have no cookies set.

I think this relates and possibly fixes #2224, #2511, #2611 and krakenjs/lusca#95

This commit basically renames _index.html to app.template.html which is more expressive, and the generated file will be app.html which avoids express.static() blocking the middleware chain, because there is no index.html anymore. Therefore routes.js:sendFile is effectively called.

Note that I tried and played around A LOT with webpack trying to find another solution, this was the most elegant one I could find.

@radianz
Copy link

radianz commented Jul 27, 2017

legend

Copy link
Member

@Awk34 Awk34 left a comment

Choose a reason for hiding this comment

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

Great work!

@daraosn
Copy link
Contributor Author

daraosn commented Jul 27, 2017

@Awk34 glad to contribute and thanks for such a nice framework!

@Awk34 Awk34 merged commit f68bd36 into angular-fullstack:master Aug 10, 2017
@Awk34 Awk34 mentioned this pull request Aug 10, 2017
1 task
@yeaske
Copy link

yeaske commented May 8, 2018

@Awk34 @daraosn What is the best way to solve this issue for code which was built from the seed before this fix? Will the renaming of _index.html to app.template.html and changes in gulpfile.babel.js, routes.js and webpack.make.js fix this?

@Awk34
Copy link
Member

Awk34 commented May 9, 2018

I certainly hope so

@daraosn
Copy link
Contributor Author

daraosn commented May 15, 2018

@yeaske yes, that's pretty much what needs to be done, please double check here: https://github.com/angular-fullstack/generator-angular-fullstack/pull/2613/files

@yeaske
Copy link

yeaske commented Jul 2, 2018

@Awk34 @daraosn Thanks! Worked perfectly.

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.

Login need to be Clicked twice. CSRF Token missing.
4 participants