You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm not sure why we originally wanted to add the token to the cache.
This cache isn't preventing a network request. It's simply preventing a
potential database write. This means the only thing we need to be
concerned about for the cache is the contents of the response. By
removing the token we no longer have references to it stored in the
clear.
This sets up the cache key based on the provider (though this is likely
static for most apps), the user id, and the response body contents. If
the response already has an etag we'll use it, otherwise we generate a
simple one based on the JSON representation. We use MD5 because that's
the default that Rails uses. This isn't for security, simply cache
lookups so we're not really concerned about slowing the hash or
collisions.
0 commit comments