Skip to content

Commit

Permalink
debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
johtso committed Apr 7, 2024
1 parent cf0316b commit 3edde7c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/access.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,12 @@ export const onRequest: CloudflareAccessPagesPluginFunction = async ({
};

return next();
} catch {}
} catch (e) {
console.log("Error.. so not authenticated?");
console.error(e);
}

console.log("Redirecting to login page");
return new Response(null, {
status: 302,
headers: {
Expand Down
1 change: 1 addition & 0 deletions src/hooks.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export const handle: Handle = async ({ event, resolve }) => {
pluginArgs: { domain: env.ACCESS_DOMAIN, aud: env.ACCESS_AUD },
data: {},
next: async () => {
console.log("authenticated, running handler");
return await handler({ event, resolve });
},
});
Expand Down

0 comments on commit 3edde7c

Please sign in to comment.