Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

chore: use new api to check login status (#27143)

Joeld7d9abb007f1
diff --git a/web/service/use-common.ts b/web/service/use-common.ts
index 3e01b721e8a..57b9c8b165d 100644
--- a/web/service/use-common.ts
+++ b/web/service/use-common.ts
@@ -116,7 +116,19 @@ export const useIsLogin = () => {
queryKey: [NAME_SPACE, 'is-login'],
staleTime: 0,
gcTime: 0,
- queryFn: () => get<isLogin>('/login/status'),
+ queryFn: async (): Promise<isLogin> => {
+ try {
+ await get('/account/profile', {
+ silent: true,
+ })
+ }
+ catch (e: any) {
+ if(e.status === 401)
+ return { logged_in: false }
+ return { logged_in: true }
+ }
+ return { logged_in: true }
+ },
})
}