Instantly share code, notes, and snippets.

What would you like to do?'/v1/login', async (req, res) => {
try {
const response = await{
uri: `${API_BASE_URL}/api/oauth2/auth?${req.body.formQuery}`,
body: req.body,
json: true,
strictSSL: false,
resolveWithFullResponse: true,
simple: false,
if (response.statusCode === 200) {
return res
.header('set-cookie', loginResponse.headers['set-cookie'])
} else {
return res
.json({ errorMessage: 'An unexpected occured' });
} catch (error) {
return res
.json({ errorMessage: 'An unexpected error occured' });
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment