Skip to content

Fixes issue affecting linking users to a 3rd party auth #4047

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

Merged
merged 4 commits into from
Jul 25, 2017

Conversation

flovilmart
Copy link
Contributor

When linking a user to an oauth provider in a client SDK (verified on iOS), the server would not check the session token for the authenticated user and the url doesn't hold the userId part of it (send as /users instead of /users/:id)

This PR addresses that issue, the userId provided by the session token will always take precedence over the query provided ID.

This should not break any installation as this server behaviour was not expected by the clients.

acinader
acinader previously approved these changes Jul 25, 2017
Copy link
Contributor

@acinader acinader left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov
Copy link

codecov bot commented Jul 25, 2017

Codecov Report

Merging #4047 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4047      +/-   ##
==========================================
+ Coverage    90.7%   90.71%   +<.01%     
==========================================
  Files         116      116              
  Lines        7911     7916       +5     
==========================================
+ Hits         7176     7181       +5     
  Misses        735      735
Impacted Files Coverage Δ
src/RestWrite.js 93.16% <100%> (-0.13%) ⬇️
src/Push/PushWorker.js 92.45% <0%> (+1.88%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e54265...ef62746. Read the comment docs.

@flovilmart
Copy link
Contributor Author

The JS SDK has a bug, all login calls are treated as link calls, unlike the other SDK'S I'll open issues there as well. The JS SDK should just strip the sessionToken when sending a login call

@flovilmart flovilmart force-pushed the issue/linking-authenticated-user branch from bfe1c24 to 10155a1 Compare July 25, 2017 18:36
@flovilmart flovilmart merged commit 92d51de into master Jul 25, 2017
@flovilmart flovilmart deleted the issue/linking-authenticated-user branch July 25, 2017 19:26
@flovilmart
Copy link
Contributor Author

Thanks @acinader :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants