Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upSwitch authentication method precedence #164
Conversation
|
This is particularly necessary because the PHP API always returns a guest session cookie, even when authenticated with an API token. This means that if you make an API call with token to PHP first, and then to Node, and your client saves the cookie (as many do), the second request will fail with a 403 |
|
makes sense! |
This changes the behavior of the auth strategies:
The only practical difference is that if both methods are passed, the token takes precedence. This does not have any impact for requests that have no
Authorizationheader set, performance or otherwise, as the entire strategy is not executed in that case (which I verified).This aligns behavior with our prior PHP API and also makes more sense in my opinion, as one is way more likely to accidentally send a cookie than an API token.