Skip to content

Commit

Permalink
poke: add log for connector redirect (#3395)
Browse files Browse the repository at this point in the history
  • Loading branch information
spolu authored Jan 23, 2024
1 parent 82abf79 commit 897d77c
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions front/pages/poke/connectors/[connectorId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import logger from "@app/logger/logger";

export const getServerSideProps: GetServerSideProps = async (context) => {
const session = await getSession(context.req, context.res);
const auth = await Authenticator.fromSuperUserSession(
session,
context.params?.wId as string
);
const auth = await Authenticator.fromSuperUserSession(session, null);

if (!auth.isDustSuperUser()) {
logger.error("poke: not superUser");
return {
notFound: true,
};
Expand All @@ -21,6 +19,7 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
const connectorId = context.params?.connectorId;

if (!connectorId || typeof connectorId !== "string") {
logger.error({ connectorId }, "poke: connectorId is not a string");
return {
notFound: true,
};
Expand All @@ -29,6 +28,10 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
const connectorsAPI = new ConnectorsAPI(logger);
const cRes = await connectorsAPI.getConnector(connectorId);
if (cRes.isErr()) {
logger.error(
{ connectorId, error: cRes.error },
"poke: error fetching connector"
);
return {
notFound: true,
};
Expand Down

0 comments on commit 897d77c

Please sign in to comment.