Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephdpurcell/15b42d4db835d5e3c803 to your computer and use it in GitHub Desktop.
Save josephdpurcell/15b42d4db835d5e3c803 to your computer and use it in GitHub Desktop.
Replace cookie authentication with token authentication on login token for RESTful 2.x
@josephdpurcell
Copy link
Author

See also https://gist.github.com/josephdpurcell/f2744a7ac38957b1e04e.

The motivation for this change is twofold:
(a) login-token will use "cookie" auth, which with an SPA is not ideal since you have to have the same user logged into the API as the client consuming the API if they are on the same domain. So, let's remove cookie auth.
(b) login-token will not use "token" auth, so if you have a valid access token (say generated and sent via an email) you cannot get the expiry and refresh token unless you re-authenticate. So, let's allow token auth.

@josephdpurcell
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment