Skip to content

Commit

Permalink
chore(middleware): remove unused variables build_image
Browse files Browse the repository at this point in the history
  • Loading branch information
brucetony committed Aug 16, 2024
1 parent 7dc4b43 commit 5ab2ad6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion middleware/auth.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
export default defineNuxtRouteMiddleware(async (to) => {
const { loggedIn, login, user } = useOidcAuth();
const { loggedIn, login } = useOidcAuth();
if (!loggedIn.value && to.path !== "/") {
console.warn("Not logged in");
return login();
Expand Down
7 changes: 4 additions & 3 deletions plugins/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import {
showHubAdapterConnectionErrorToast,
} from "~/composables/connectionErrorToast";

export default defineNuxtPlugin((nuxtApp) => {
export default defineNuxtPlugin(() => {
const { user, login } = useOidcAuth();
const config = useRuntimeConfig();
const baseUrl = config.public.hubAdapterUrl as string;
Expand All @@ -22,12 +22,13 @@ export default defineNuxtPlugin((nuxtApp) => {
},
onResponseError({ request, response }) {
// Handle the response errors
console.log(response);
if (response.status === 401 || response.status === 403) {
console.warn("User not signed in, routing to login");
console.warn("User not signed in, returning to login");
return login();
}

console.log(response);

if (response.status === 500) {
if (typeof request === "string" && request.includes("kong")) {
showKongConnectionErrorToast();
Expand Down

0 comments on commit 5ab2ad6

Please sign in to comment.