diff --git a/ui/api-templates/http-client.ejs b/ui/api-templates/http-client.ejs index 6df6482..387faba 100644 --- a/ui/api-templates/http-client.ejs +++ b/ui/api-templates/http-client.ejs @@ -38,7 +38,7 @@ export enum ContentType { } -const whitePathnameList = ['/user/login', '/login']; +const whitePathnameList = ['/user/login', '/login', '/auth']; const whiteApiList = ['/api/v1/user/profile', '/api/v1/admin/profile']; const redirectToLogin = () => { diff --git a/ui/src/api/httpClient.ts b/ui/src/api/httpClient.ts index 26497ca..b48c1d8 100644 --- a/ui/src/api/httpClient.ts +++ b/ui/src/api/httpClient.ts @@ -58,7 +58,7 @@ export enum ContentType { Text = "text/plain", } -const whitePathnameList = ["/user/login", "/login"]; +const whitePathnameList = ["/user/login", "/login", "/auth"]; const whiteApiList = ["/api/v1/user/profile", "/api/v1/admin/profile"]; const redirectToLogin = () => { diff --git a/ui/src/main.tsx b/ui/src/main.tsx index 06c0be9..f5b82fa 100644 --- a/ui/src/main.tsx +++ b/ui/src/main.tsx @@ -45,10 +45,9 @@ const App = () => { .finally(() => { setLoading(false); }); - } else { + } else if (!location.pathname.startsWith('/auth')) { return getAdminProfile() .then((res) => { - console.log(res); setUser(res); if (location.pathname.startsWith('/login')) { onGotoRedirect('admin'); @@ -57,6 +56,8 @@ const App = () => { .finally(() => { setLoading(false); }); + } else { + setLoading(false); } };