Skip to content

Commit

Permalink
fix: fix login screen is show for canary checker image
Browse files Browse the repository at this point in the history
Fixes #2267
  • Loading branch information
mainawycliffe authored and moshloop committed Sep 10, 2024
1 parent 513663d commit 55eeec7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
11 changes: 10 additions & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,19 @@ import AuthSessionChecker from "../src/components/Authentication/AuthSessionChec
import { isCanaryUI } from "../src/context/Environment";

const Home: NextPage = () => {
// For the canary UI, we don't have any authentication system in place
if (isCanaryUI) {
return (
<div className="container-fluid flex flex-col overflow-auto">
<CanaryCheckerApp />
</div>
);
}

return (
<AuthSessionChecker>
<div className="container-fluid flex flex-col overflow-auto">
{isCanaryUI ? <CanaryCheckerApp /> : <App />}
<App />
</div>
</AuthSessionChecker>
);
Expand Down
6 changes: 5 additions & 1 deletion src/api/axios.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { toastError } from "@flanksource-ui/components/Toast/toast";
import { isCanaryUI } from "@flanksource-ui/context/Environment";
import axios, { AxiosError } from "axios";

const isClerkAuthSystem = !!process.env.NEXT_PUBLIC_AUTH_IS_CLERK === true;
Expand Down Expand Up @@ -150,7 +151,10 @@ for (const client of [
return response;
},
(error) => {
redirectToLoginPageOnSessionExpiry(error);
// For canary UI, we don't have an auth system in place
if (!isCanaryUI) {
redirectToLoginPageOnSessionExpiry(error);
}
if ("code" in (error as any)) {
// Show a toast message for timeout and network errors
if (error.code === "ECONNABORTED") {
Expand Down

0 comments on commit 55eeec7

Please sign in to comment.