Skip to content
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

[BUG][API] /api/v1/settings.oauth identifier field inconsistency #10546

Closed
cardoso opened this issue Apr 22, 2018 · 2 comments
Closed

[BUG][API] /api/v1/settings.oauth identifier field inconsistency #10546

cardoso opened this issue Apr 22, 2018 · 2 comments
Projects
Milestone

Comments

@cardoso
Copy link
Contributor

cardoso commented Apr 22, 2018

Getting inconsistent results from our new REST API.

Identifier comes as _id:

{"services":[{"_id":"ooGRhWvEPrLx9vPFB","service":"open","clientId":"h8K3pqagWgqxBE2cp","custom":true,"serverURL":"https://open.rocket.chat","tokenPath":"/oauth/token","identityPath":"/api/v1/me","authorizePath":"/oauth/authorize","scope":"openid","buttonLabelText":"open","buttonLabelColor":"#FFFFFF","loginStyle":"popup","buttonColor":"#13679A","tokenSentVia":"payload","identityTokenSentVia":null,"usernameField":"username","mergeUsers":true}],"success":true}

Identifier comes as id:

{"services":[{"id":"eEYuSPY7KpjtFeCrY","name":"facebook","clientId":"835103589938459","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"pC7Ye83eYPgRz9yXm","name":"github","clientId":"886a7b2a1fb067b10d3a","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"R6x57fMdjLfSJCKHi","name":"gitlab","clientId":"ad37be86b2fe45ab494ea51cffffa673c89c240e9fa6addfbedd06a587707731","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"antN9dgpGFNjYq3Gi","name":"google","clientId":"662030055877-uma7qar29ji84gopa740fasv2f6rfj1v.apps.googleusercontent.com","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"WcJkBdR2FGQc2asbt","name":"linkedin","clientId":"77j932xbl3gl62","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"ZLdFDrMkEiJMnDQQY","name":"meteor-developer","clientId":"LDGYjcX2knskEP8HR","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false},{"id":"9S5Q7d7An5iwJRzHK","name":"twitter","buttonLabelText":"","buttonColor":"","buttonLabelColor":"","custom":false}],"success":true}

Perhaps when it's a custom oauth it's coming as "_id" and when it's a built-in oauth it's coming as "id".

Let's make everything "_id". Other v1 endpoints are using "_id" like /api/v1/custom-emoji.

@cardoso cardoso changed the title [BUG][API] /api/v1/settings.oauth [BUG][API] /api/v1/settings.oauth identifier field inconsistency Apr 22, 2018
@cardoso
Copy link
Contributor Author

cardoso commented Apr 22, 2018

Causing this bug on iOS: RocketChat/Rocket.Chat.iOS#1577

@graywolf336
Copy link
Contributor

graywolf336 commented Apr 22, 2018

@MarcosSpessatto let's do this and get it merged this week, as it's a regression due to the newly added endpoint

@rodrigok rodrigok added this to the 0.64.0 milestone Apr 24, 2018
@rodrigok rodrigok added this to Desireable in 0.64.0 via automation Apr 24, 2018
0.64.0 automation moved this from Desireable to Done Apr 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
0.64.0
  
Done
Development

No branches or pull requests

3 participants