Skip to content

Commit

Permalink
Revert "Rename apiResponse field from userName to username"
Browse files Browse the repository at this point in the history
This reverts commit c3dc18e.
  • Loading branch information
peterMuriuki committed Jun 17, 2020
1 parent 03775b9 commit 76943f0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/gatekeeper/src/helpers/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export function getOnadataUserInfo(apiResponse: { [key: string]: any }): Session
* @param {{[key: string]: any }} apiResponse - the API response object
*/
export function getOpenSRPUserInfo(apiResponse: { [key: string]: any }): SessionState {
if (!apiResponse.username) {
if (!apiResponse.userName) {
throw new Error(OAUTH2_CALLBACK_ERROR);
}
return {
Expand All @@ -63,7 +63,7 @@ export function getOpenSRPUserInfo(apiResponse: { [key: string]: any }): Session
email: '',
gravatar: '',
name: '',
username: apiResponse.username
username: apiResponse.userName
}
};
}
4 changes: 2 additions & 2 deletions packages/gatekeeper/src/helpers/tests/fixtures.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export const onadataSessionWithOauthData = {
export const openSRPResponse = {
preferredName: 'mosh',
roles: ['Privilege Level: Full'],
username: 'moshthepitt'
userName: 'moshthepitt'
};

export const openSRPFinalData = {
Expand All @@ -96,7 +96,7 @@ export const openSRPSession = {
email: '',
gravatar: '',
name: '',
username: openSRPResponse.username
username: openSRPResponse.userName
}
};

Expand Down

0 comments on commit 76943f0

Please sign in to comment.