propro-utils 1.4.54 → 1.4.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.4.54",
3
+ "version": "1.4.55",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -113,6 +113,9 @@ function proproAuthMiddleware(options = {}, userSchema) {
113
113
  return res.status(400).send('No code received');
114
114
  }
115
115
 
116
+ console.log('code: ', code);
117
+ console.log('redirectUri: ', redirectUri);
118
+
116
119
  const { tokens, account, redirectUrl } = await exchangeToken(
117
120
  authUrl,
118
121
  code,
@@ -121,11 +124,13 @@ function proproAuthMiddleware(options = {}, userSchema) {
121
124
  redirectUri
122
125
  );
123
126
 
127
+ console.log('tokens: ', tokens);
128
+
124
129
  const user = await checkIfUserExists(userSchema, account.accountId);
125
130
 
126
- setAuthCookies(res, tokens, account, user, appUrl);
131
+ setAuthCookies(res, tokens, account, user, redirectUrl);
127
132
 
128
- const urlToRedirect = formatRedirectUrl(appUrl);
133
+ const urlToRedirect = formatRedirectUrl(redirectUrl);
129
134
 
130
135
  return res.redirect(urlToRedirect);
131
136
  }