fix(ui): duplicate basePath in Logout Button Link (#11432)

This PR resolves an issue where the `href` for the Logout button in the
admin panel included duplicate `basePath` values when `basePath` was set
in `next.config.js`.

The Logout button was recently updated to use `NextLink` (`next/link`),
which automatically applies the `basePath` from the Next.js
configuration. As a result, manually adding the `basePath` to the `href`
is no longer necessary.

Relevant PRs that modified this behavior originally: 
- #9275
- #11155
This commit is contained in:
Patrik
2025-02-27 13:58:27 -05:00
committed by GitHub
parent 9c25e7b68e
commit f7b1cd9d63

View File

@@ -28,8 +28,6 @@ export const Logout: React.FC<{
routes: { admin: adminRoute }, routes: { admin: adminRoute },
} = config } = config
const basePath = process.env.NEXT_BASE_PATH ?? ''
const props = { const props = {
'aria-label': t('authentication:logOut'), 'aria-label': t('authentication:logOut'),
className: `${baseClass}__log-out`, className: `${baseClass}__log-out`,
@@ -43,7 +41,6 @@ export const Logout: React.FC<{
{...props} {...props}
href={formatAdminURL({ href={formatAdminURL({
adminRoute, adminRoute,
basePath,
path: logoutRoute, path: logoutRoute,
})} })}
> >