@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/.turbo/turbo-build$colon$types.log +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +2 -2
- package/package.json +1 -1
- package/src/middleware.ts +2 -2
package/package.json
CHANGED
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,
|
|
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);
|