mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 01:29:31 +08:00
fix(workspace): check affine login auth (#2070)
This commit is contained in:
@@ -20,6 +20,19 @@ export function useSyncRouterWithCurrentWorkspaceId(router: NextRouter) {
|
||||
return;
|
||||
}
|
||||
if (currentWorkspaceId) {
|
||||
if (currentWorkspaceId !== workspaceId) {
|
||||
const target = metadata.find(workspace => workspace.id === workspaceId);
|
||||
if (!target) {
|
||||
// workspaceId is invalid, redirect to currentWorkspaceId
|
||||
void router.push({
|
||||
pathname: router.pathname,
|
||||
query: {
|
||||
...router.query,
|
||||
workspaceId: currentWorkspaceId,
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
const targetWorkspace = metadata.find(
|
||||
|
||||
Reference in New Issue
Block a user