Skip to content

Commit c6cb26b

Browse files
authored
Fill "next" parameter with the current page on login (GeoNode#299)
1 parent dc9ce65 commit c6cb26b

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

geonode_mapstore_client/client/js/components/home/BrandNavbar.jsx

+11-1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,16 @@ const BrandNavbar = forwardRef(({
1818
inline
1919
}, ref) => {
2020

21+
22+
const navItemsHrefPath = navItems.map( (item) => {
23+
const hrefPath = (item?.href?.slice(-1) === '=')
24+
? item.href + location.pathname + location.hash
25+
: item.href;
26+
return {
27+
...item,
28+
href: hrefPath
29+
};
30+
});
2131
const centerNode = useRef();
2232
const centerWidth = centerNode.current
2333
? centerNode.current.getBoundingClientRect().width
@@ -51,7 +61,7 @@ const BrandNavbar = forwardRef(({
5161
{centerWidth >= centerMinWidth && children}
5262
</div>}
5363
<Menu
54-
items={[...navItems].reverse()}
64+
items={[...navItemsHrefPath].reverse()}
5565
containerClass={`gn-brand-navbar-right-side`}
5666
childrenClass={`gn-user-dropdown`}
5767
alignRight

geonode_mapstore_client/client/static/mapstore/configs/localConfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@
389389
{
390390
"labelId": "gnhome.signIn",
391391
"type": "link",
392-
"href": "/account/login/?next=/",
392+
"href": "/account/login/?next=",
393393
"authenticated": false
394394
},
395395
{

0 commit comments

Comments
 (0)