propro-utils 1.4.15 → 1.4.17
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 +14 -1
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -115,7 +115,9 @@ function proproAuthMiddleware(options = {}, userSchema) {
|
|
|
115
115
|
redirectUri
|
|
116
116
|
);
|
|
117
117
|
|
|
118
|
+
console.log('tokens', tokens);
|
|
118
119
|
const user = await checkIfUserExists(userSchema, account.accountId);
|
|
120
|
+
console.log('user', user);
|
|
119
121
|
|
|
120
122
|
const currentDateTime = new Date();
|
|
121
123
|
|
|
@@ -146,7 +148,18 @@ function proproAuthMiddleware(options = {}, userSchema) {
|
|
|
146
148
|
|
|
147
149
|
res.cookie('account', JSON.stringify(account));
|
|
148
150
|
|
|
149
|
-
|
|
151
|
+
console.log('redirectUrl', redirectUrl);
|
|
152
|
+
|
|
153
|
+
let urlToRedirect;
|
|
154
|
+
|
|
155
|
+
if (!redirectUrl.startsWith('http://') && !redirectUrl.startsWith('https://')) {
|
|
156
|
+
urlToRedirect = redirectUrl.includes('app.mapmap.app') ? `https://${redirectUrl}/` : `http://${redirectUrl}/`;
|
|
157
|
+
} else {
|
|
158
|
+
urlToRedirect = redirectUrl;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
|
|
162
|
+
console.log('urlToRedirect', urlToRedirect);
|
|
150
163
|
|
|
151
164
|
return res.redirect(urlToRedirect);
|
|
152
165
|
}
|