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:
@@ -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,
|
||||||
})}
|
})}
|
||||||
>
|
>
|
||||||
|
|||||||
Reference in New Issue
Block a user