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

[V2][Sessions] Make it easy/fast to use CSRF tokens with sessions (SPA & regular apps) #802

Merged
merged 23 commits into from
Aug 28, 2020

Conversation

LoicPoullain
Copy link
Member

@LoicPoullain LoicPoullain commented Aug 21, 2020

Issue

Fixes #798

Solution

The CSRF protection is managed directly by @TokenXXX and @JWTXXX.

The JWT package has two new functions: setAuthCookie and removeAuthCookie.

Breaking changes

  • The configuration settings.jwt.secretOrPublicKey has been renamed to settings.jwt.secret and settings.jwt.publicKey.
  • The CSRF protection does not need an additional secret anymore or to specify an expire time for the CSRF cookie.
  • The @foal/csrf has been removed. CSRF defense is directly managed by the hooks @Token and @JWT.

Checklist

  • Add/update/check docs (code comments and docs/ folder).
  • Add/update/check tests.
  • Update/check the cli generators.

@LoicPoullain LoicPoullain added this to Work In Progress in Issue tracking via automation Aug 21, 2020
@LoicPoullain LoicPoullain changed the title Csrf simplified [V2][Sessions] Make it easy/fast to use CSRF tokens with sessions (SPA & regular apps) Aug 21, 2020
@LoicPoullain LoicPoullain mentioned this pull request Aug 28, 2020
@LoicPoullain LoicPoullain merged commit 06718af into v2-0-0 Aug 28, 2020
Issue tracking automation moved this from Work In Progress to Done / Closed This Release Aug 28, 2020
@LoicPoullain LoicPoullain deleted the csrf-simplified branch August 28, 2020 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Issue tracking
  
Done / Closed This Release
Development

Successfully merging this pull request may close these issues.

None yet

1 participant