propro-utils 1.5.13 → 1.5.15
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.
|
@@ -66,9 +66,7 @@ const getAccountProfile = async (redisClient, userSchema, accountId) => {
|
|
|
66
66
|
* @returns {Promise<user>} - A promise that resolves once the check/create operation is done.
|
|
67
67
|
*/
|
|
68
68
|
const checkIfUserExists = async (userSchema, accountId) => {
|
|
69
|
-
console.log('accountId', accountId);
|
|
70
69
|
const user = await userSchema.findOne({ accountId });
|
|
71
|
-
console.log('user', user);
|
|
72
70
|
if (!user) {
|
|
73
71
|
try {
|
|
74
72
|
const user = await userSchema.create({
|
|
@@ -81,8 +79,6 @@ const checkIfUserExists = async (userSchema, accountId) => {
|
|
|
81
79
|
throw new Error('Error creating user');
|
|
82
80
|
}
|
|
83
81
|
}
|
|
84
|
-
console.log('user', user);
|
|
85
|
-
return user;
|
|
86
82
|
};
|
|
87
83
|
|
|
88
84
|
module.exports = {
|
package/package.json
CHANGED
package/src/server/index.js
CHANGED
|
@@ -322,13 +322,13 @@ class AuthMiddleware {
|
|
|
322
322
|
pathRequiresAccessToken = path => {
|
|
323
323
|
return (
|
|
324
324
|
!path.includes('/api/v1/auth/login') &&
|
|
325
|
-
!path.includes('/api/v1/auth/
|
|
325
|
+
!path.includes('/api/v1/auth/signup')
|
|
326
326
|
);
|
|
327
327
|
};
|
|
328
328
|
|
|
329
329
|
proxyToAuthServer = async (req, path) => {
|
|
330
330
|
let accessToken = null;
|
|
331
|
-
if (
|
|
331
|
+
if (this.pathRequiresAccessToken(path)) {
|
|
332
332
|
console.log('path requires access token');
|
|
333
333
|
accessToken = req.cookies['x-access-token'];
|
|
334
334
|
if (!accessToken) {
|