diff --git a/Cargo.lock b/Cargo.lock index f52b7a1907..fc5217cc04 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7949,9 +7949,9 @@ dependencies = [ [[package]] name = "zune-jpeg" -version = "0.5.12" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "410e9ecef634c709e3831c2cfdb8d9c32164fae1c67496d5b68fff728eec37fe" +checksum = "ec5f41c76397b7da451efd19915684f727d7e1d516384ca6bd0ec43ec94de23c" dependencies = [ "zune-core", ] diff --git a/web/src/routes/_authorized.tsx b/web/src/routes/_authorized.tsx index 5414bcfa4b..3cb8ae7321 100644 --- a/web/src/routes/_authorized.tsx +++ b/web/src/routes/_authorized.tsx @@ -8,7 +8,7 @@ import { UpgradeEnterpriseModal } from '../shared/components/modals/license/Upgr import { SelectionModal } from '../shared/components/modals/SelectionModal/SelectionModal'; import { AppInfoProvider } from '../shared/providers/AppInfoProvider'; import { AppUserProvider } from '../shared/providers/AppUserProvider'; -import { getSessionInfoQueryOptions } from '../shared/query'; +import { getSessionInfoQueryOptions, getUserMeQueryOptions } from '../shared/query'; export const Route = createFileRoute('/_authorized')({ component: RouteComponent, @@ -27,6 +27,22 @@ export const Route = createFileRoute('/_authorized')({ throw redirect({ to: '/migration', replace: true }); } } + + if (sessionInfo.is_admin) { + return; + } + + const me = (await context.queryClient.fetchQuery(getUserMeQueryOptions)).data; + + if (location.pathname !== `/user/${me.username}`) { + throw redirect({ + to: '/user/$username', + params: { + username: me.username, + }, + replace: true, + }); + } }, });