propro-utils 1.4.53 → 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/index.js +1 -0
- package/src/server/index.js +7 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/server/index.js
CHANGED
|
@@ -100,7 +100,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
|
|
|
100
100
|
|
|
101
101
|
const user = await checkIfUserExists(userSchema, account.accountId);
|
|
102
102
|
|
|
103
|
-
setAuthCookies(res, { access, refresh }, account, user);
|
|
103
|
+
setAuthCookies(res, { access, refresh }, account, user, appUrl);
|
|
104
104
|
|
|
105
105
|
return res
|
|
106
106
|
.status(200)
|
|
@@ -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,9 +124,11 @@ 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
133
|
const urlToRedirect = formatRedirectUrl(redirectUrl);
|
|
129
134
|
|