diff --git a/web/satellite/index-vuetify.html b/web/satellite/index-vuetify.html index 4e399fc450ed..cb5eb758c6e6 100644 --- a/web/satellite/index-vuetify.html +++ b/web/satellite/index-vuetify.html @@ -19,11 +19,17 @@ border: 4px solid rgb(1,73,255); border-top: 4px solid transparent; border-radius: 50%; - width: 50px; - height: 50px; + width: 90px; + height: 90px; animation: spin .7s linear infinite; } + #pre-app-loader img { + position: absolute; + inset: 0; + margin: auto; + } + @keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } @@ -31,7 +37,10 @@ -
+
+
+ loader +
diff --git a/web/satellite/src/types/router.ts b/web/satellite/src/types/router.ts index f923252e2496..3e6296fb9acd 100644 --- a/web/satellite/src/types/router.ts +++ b/web/satellite/src/types/router.ts @@ -69,4 +69,6 @@ export abstract class RouteConfig { public static BucketsDetails = new NavigationLink('details', 'Bucket Details'); public static UploadFile = new NavigationLink('upload/', 'Objects Upload'); public static UploadFileChildren = new NavigationLink(':pathMatch*', 'Objects Upload Children'); + + public static AuthRoutes = ['/login', '/signup', '/forgot-password', '/activate', '/password-recovery', '/signup-confirmation', '/password-reset-confirmation']; } diff --git a/web/satellite/src/utils/httpClient.ts b/web/satellite/src/utils/httpClient.ts index 1dcadb82546e..cc07ae831c24 100644 --- a/web/satellite/src/utils/httpClient.ts +++ b/web/satellite/src/utils/httpClient.ts @@ -3,6 +3,7 @@ import { ErrorUnauthorized } from '@/api/errors/ErrorUnauthorized'; import { useConfigStore } from '@/store/modules/configStore'; +import { RouteConfig } from '@/types/router'; /** * HttpClient is a custom wrapper around fetch api. @@ -83,8 +84,8 @@ export class HttpClient { * Call logout and redirect to login. */ private async handleUnauthorized(): Promise { - const path = window.location.href; - if (!path.includes('/login') && !path.includes('/signup')) { + let path = window.location.href; + if (!this.isAuthRoute(path)) { try { const logoutPath = '/api/v0/auth/logout'; const request: RequestInit = { @@ -102,6 +103,11 @@ export class HttpClient { } setTimeout(() => { + // path may have changed after timeout. + path = window.location.href; + if (this.isAuthRoute(path)) { + return; + } const origin = window.location.origin; if (document.querySelector('.v-overlay-container')) { window.location.href = origin + useConfigStore().optionalV2Path + '/login'; @@ -111,4 +117,8 @@ export class HttpClient { }, 2000); } } + + private isAuthRoute(path: string): boolean { + return RouteConfig.AuthRoutes.some((route) => path.includes(route)); + } } diff --git a/web/satellite/vuetify-poc/src/App.vue b/web/satellite/vuetify-poc/src/App.vue index 26a12e9b174e..f253151f5364 100644 --- a/web/satellite/vuetify-poc/src/App.vue +++ b/web/satellite/vuetify-poc/src/App.vue @@ -2,23 +2,48 @@ // See LICENSE for copying information. diff --git a/web/satellite/vuetify-poc/src/components/utils/BrandedLoader.vue b/web/satellite/vuetify-poc/src/components/utils/BrandedLoader.vue new file mode 100644 index 000000000000..91430fa5c683 --- /dev/null +++ b/web/satellite/vuetify-poc/src/components/utils/BrandedLoader.vue @@ -0,0 +1,49 @@ +// Copyright (C) 2024 Storj Labs, Inc. +// See LICENSE for copying information. + + + + \ No newline at end of file diff --git a/web/satellite/vuetify-poc/src/layouts/default/AllProjects.vue b/web/satellite/vuetify-poc/src/layouts/default/AllProjects.vue index 39ef2abc8d4a..c5a90abb1262 100644 --- a/web/satellite/vuetify-poc/src/layouts/default/AllProjects.vue +++ b/web/satellite/vuetify-poc/src/layouts/default/AllProjects.vue @@ -3,10 +3,7 @@ diff --git a/web/satellite/vuetify-poc/src/layouts/default/Default.vue b/web/satellite/vuetify-poc/src/layouts/default/Default.vue index ae6d3ab863ed..dab2cd6c0c03 100644 --- a/web/satellite/vuetify-poc/src/layouts/default/Default.vue +++ b/web/satellite/vuetify-poc/src/layouts/default/Default.vue @@ -3,9 +3,7 @@