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 +1 -1
- package/src/server/index.js +7 -2
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -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,
|
|
131
|
+
setAuthCookies(res, tokens, account, user, redirectUrl);
|
|
127
132
|
|
|
128
|
-
const urlToRedirect = formatRedirectUrl(
|
|
133
|
+
const urlToRedirect = formatRedirectUrl(redirectUrl);
|
|
129
134
|
|
|
130
135
|
return res.redirect(urlToRedirect);
|
|
131
136
|
}
|