Commit e401d41d authored by Randall Leeds's avatar Randall Leeds

Fight the proliferation of csrf nonsense

I had tried to remove it, thinking the `csrf` one wasn't used because
`identity` used `csrf_token` but unfortunately the `session` module
still used `csrf` and deleted it from the model during the response
transform. Instead, let the `csrf` value stick to the model to be
available on session object and mark the `csrf_token` value as the
deprecated one in the backend. Support for that will drop further in
the future.
parent 6ef9d992
...@@ -27,7 +27,7 @@ identityFactory = [ ...@@ -27,7 +27,7 @@ identityFactory = [
if loggedInUser is null if loggedInUser is null
if persona if persona
loggedInUser = persona loggedInUser = persona
onlogin?(session.csrf_token) onlogin?(session.csrf)
else else
onmatch?() onmatch?()
else if loggedInUser else if loggedInUser
...@@ -36,14 +36,14 @@ identityFactory = [ ...@@ -36,14 +36,14 @@ identityFactory = [
onmatch?() onmatch?()
else else
loggedInUser = persona loggedInUser = persona
onlogin?(session.csrf_token) onlogin?(session.csrf)
else else
loggedInUser = null loggedInUser = null
onlogout?() onlogout?()
else else
if persona if persona
loggedInUser = persona loggedInUser = persona
onlogin?(session.csrf_token) onlogin?(session.csrf)
else else
loggedInUser = null loggedInUser = null
onlogout?() onlogout?()
......
...@@ -81,7 +81,6 @@ class SessionProvider ...@@ -81,7 +81,6 @@ class SessionProvider
# Capture the cross site request forgery token without cookies. # Capture the cross site request forgery token without cookies.
# If cookies are blocked this is our only way to get it. # If cookies are blocked this is our only way to get it.
csrfToken = model.csrf csrfToken = model.csrf
delete model.csrf
# Return the model # Return the model
model model
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment