propro-utils 1.4.53 → 1.4.54

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.53",
3
+ "version": "1.4.54",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/index.js CHANGED
@@ -50,6 +50,7 @@ module.exports = function proproAuthMiddleware(options = {}, userSchema) {
50
50
  'CLIENT_SECRET',
51
51
  'CLIENT_URL',
52
52
  'REDIRECT_URI',
53
+ 'APP_URL',
53
54
  ]);
54
55
  return (req, res, next) => {
55
56
  try {
@@ -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)
@@ -125,7 +125,7 @@ function proproAuthMiddleware(options = {}, userSchema) {
125
125
 
126
126
  setAuthCookies(res, tokens, account, user, appUrl);
127
127
 
128
- const urlToRedirect = formatRedirectUrl(redirectUrl);
128
+ const urlToRedirect = formatRedirectUrl(appUrl);
129
129
 
130
130
  return res.redirect(urlToRedirect);
131
131
  }