oauth-node-client
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -25,3 +25,8 @@ "use strict"; | ||
case 0: | ||
_context.next = 2; | ||
if (!_services.container.get(userId)) { | ||
_context.next = 5; | ||
break; | ||
} | ||
_context.next = 3; | ||
return _services.axios.get(_constants.endPoints.getProfile, { | ||
@@ -35,7 +40,13 @@ headers: { | ||
case 2: | ||
case 3: | ||
data = _context.sent; | ||
return _context.abrupt("return", data); | ||
case 4: | ||
case 5: | ||
return _context.abrupt("return", { | ||
code: 400, | ||
message: "UserId not found in container." | ||
}); | ||
case 6: | ||
case "end": | ||
@@ -42,0 +53,0 @@ return _context.stop(); |
{ | ||
"name": "oauth-node-client", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "371Digital oAuth Node Client", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -5,10 +5,17 @@ import { axios, container } from "services"; | ||
const getUserData = async (userId) => { | ||
const data = await axios.get(endPoints.getProfile, { | ||
headers: { | ||
"x-access-token": container.get(userId) | ||
} | ||
}).then((res) => res.data); | ||
return data; | ||
if (container.get(userId)) { | ||
const data = await axios.get(endPoints.getProfile, { | ||
headers: { | ||
"x-access-token": container.get(userId) | ||
} | ||
}).then((res) => res.data); | ||
return data; | ||
} | ||
return { | ||
code: 400, | ||
message: "UserId not found in container." | ||
} | ||
}; | ||
export default getUserData; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
11922
288