@eduzz/miau-client 1.4.5 → 1.4.6-rc.24

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": "@eduzz/miau-client",
3
- "version": "1.4.5",
3
+ "version": "1.4.6-rc.24",
4
4
  "description": "Eduzz Miau Client",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
package/src/middleware.ts CHANGED
@@ -101,8 +101,9 @@ export const miauMiddleware = <T>(
101
101
  return async (req: Request, res: Response, next: NextFunction) => {
102
102
  try {
103
103
  const token = req.headers.authorization?.split(' ').pop() ?? '';
104
+ const fullPath = (req.baseUrl + req.path).replace(/\/+$/, '') || '/';
104
105
 
105
- const [miauApplication, miauMetadata] = await auth(token, req.method, req.path, miauClient);
106
+ const [miauApplication, miauMetadata] = await auth(token, req.method, fullPath, miauClient);
106
107
 
107
108
  req.miauApplication = miauApplication;
108
109
  req.miauMetadata = miauMetadata;
@@ -133,7 +134,6 @@ export const miauHook = <T>(
133
134
  return async (request: FastifyRequest, reply: FastifyReply) => {
134
135
  try {
135
136
  const token = request.headers.authorization?.split(' ').pop() ?? '';
136
-
137
137
  const path = request.routeOptions.url ?? '';
138
138
 
139
139
  const [miauApplication, miauMetadata] = await auth(token, request.method, path, miauClient);