Skip to content

Commit

Permalink
fix: check that api token have been provided before attaching the adm…
Browse files Browse the repository at this point in the history
…in routes
  • Loading branch information
adrien2p committed Nov 2, 2022
1 parent c9a601d commit cb392b2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/medusa-plugin-sentry/src/api/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export default function (rootDirectory, pluginOptions: SentryOptions): Router {
enableTracing = true,
enableRequestHandler = true,
webHookOptions,
apiToken,
...options
} = pluginOptions;

Expand All @@ -46,7 +47,9 @@ export default function (rootDirectory, pluginOptions: SentryOptions): Router {
attachSentryWebHook(router, webHookOptions);
}

attachAdminEndPoints(router, rootDirectory, pluginOptions);
if (apiToken) {
attachAdminEndPoints(router, rootDirectory, pluginOptions);
}

return router;
}
Expand Down

0 comments on commit cb392b2

Please sign in to comment.