propro-utils 1.3.37 → 1.3.39

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,8 +1,9 @@
1
1
  {
2
2
  "name": "propro-utils",
3
- "version": "1.3.37",
3
+ "version": "1.3.39",
4
4
  "description": "Auth middleware for propro-auth",
5
5
  "main": "src/index.js",
6
+ "type": "module",
6
7
  "scripts": {
7
8
  "test": "echo \"Error: no test specified\" && exit 1",
8
9
  "email": "email dev ",
@@ -47,7 +47,11 @@ function proproAuthMiddleware(options = {}, userSchema) {
47
47
  if (req.path === "/api/refreshToken") {
48
48
  const refreshToken = req.cookies["x-refresh-token"];
49
49
  if (!refreshToken) {
50
- return res.status(401).json({error: "No refresh token provided"});
50
+ const authClientUrl = `${clientUrl}/signin`;
51
+ const redirectUrl = `${authClientUrl}?response_type=code&appName=${appName}&client_id=${clientId}&redirect_uri=${encodeURIComponent(
52
+ redirectUri
53
+ )}`;
54
+ res.status(401).json({redirectUrl, error: "No refresh token provided"});
51
55
  }
52
56
 
53
57
  const {accountData, access, refresh} = await post(`${authUrl}/api/v1/auth/refreshTokens`, {