propro-utils 1.4.11 → 1.4.13

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.11",
3
+ "version": "1.4.13",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -38,7 +38,6 @@ function proproAuthMiddleware(options = {}, userSchema) {
38
38
  return next();
39
39
  }
40
40
 
41
- console.log('req.path', req.path);
42
41
  if (req.path === '/api/auth') {
43
42
  const redirectUrl = constructRedirectUrl(clientUrl, appName, clientId, redirectUri);
44
43
  return res.status(200).json({redirectUrl});
@@ -116,9 +115,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
116
115
  redirectUri
117
116
  );
118
117
 
119
- console.log("checkIfUserExists", account.accountId)
120
118
  const user = await checkIfUserExists(userSchema, account.accountId);
121
- console.log("user", user)
122
119
 
123
120
  const currentDateTime = new Date();
124
121
 
@@ -126,7 +123,6 @@ function proproAuthMiddleware(options = {}, userSchema) {
126
123
  new Date(tokens.refresh.expires).getTime() -
127
124
  currentDateTime.getTime();
128
125
 
129
- console.log("setting cookies")
130
126
 
131
127
  res.cookie('x-refresh-token', tokens.refresh.token, {
132
128
  httpOnly: true,
@@ -134,7 +130,6 @@ function proproAuthMiddleware(options = {}, userSchema) {
134
130
  maxAge: refreshMaxAge,
135
131
  });
136
132
 
137
- console.log("setting cookies")
138
133
 
139
134
  const accessMaxAge =
140
135
  new Date(tokens.access.expires).getTime() - currentDateTime.getTime();
@@ -145,16 +140,12 @@ function proproAuthMiddleware(options = {}, userSchema) {
145
140
  maxAge: accessMaxAge,
146
141
  });
147
142
 
148
- console.log("setting cookies")
149
143
 
150
144
  res.cookie('user', JSON.stringify(user));
151
145
 
152
- console.log("setting cookies")
153
146
 
154
147
  res.cookie('account', JSON.stringify(account));
155
-
156
- console.log("setting cookies", redirectUrl)
157
-
148
+
158
149
  const urlToRedirect = `http://${redirectUrl}/`;
159
150
 
160
151
  return res.redirect(urlToRedirect);