Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions core/src/main/java/org/fao/geonet/util/XslUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -563,6 +563,9 @@ public static boolean isAuthenticated() throws Exception {
public static boolean isDisableLoginForm() {
SecurityProviderConfiguration securityProviderConfiguration = SecurityProviderConfiguration.get();

if ("gn5".equals(System.getProperty("geonetwork.security.type"))) {
return false;
}
if (securityProviderConfiguration != null) {
// No login form if providing a link or autologin
return securityProviderConfiguration.getLoginType().equals(SecurityProviderConfiguration.LoginType.AUTOLOGIN.toString().toLowerCase())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
data-ng-if="!authenticated && service !== 'catalog.signin' && service !== 'new.account' && isShowLoginAsLink"
>
<a
href="{{signInFormAction}}?_csrf={{csrf}}&redirectUrl={{redirectUrlAfterSign}}"
href="{{gnCfg.mods.authentication.signinUrl}}?_csrf={{csrf}}&redirectUrl={{redirectUrlAfterSign}}"
title="{{'signIn'|translate}}"
class="gn-menuheader-xs"
data-ng-keypress="$event"
Expand All @@ -86,7 +86,7 @@
data-ng-if="!authenticated && service !== 'catalog.signin' && service !== 'new.account' && !isShowLoginAsLink && !isDisableLoginForm"
>
<a
href="{{gnCfg.mods.authentication.signinUrl | signInLink}}"
href="{{signInFormLinkWithHash}}"
title="{{'signIn'|translate}}"
class="dropdown-toggle gn-menuheader-xs"
data-ng-keypress="$event"
Expand All @@ -102,7 +102,7 @@
<form
name="gnSigninForm"
class="navbar-form"
action="{{signInFormAction}}"
action="{{signInFormActionWithHash}}"
method="post"
role="form"
>
Expand Down
11 changes: 9 additions & 2 deletions web-ui/src/main/resources/catalog/js/CatController.js
Original file line number Diff line number Diff line change
Expand Up @@ -1265,7 +1265,11 @@
authentication: {
enabled: true,
signinUrl: "../../{{node}}/{{lang}}/catalog.signin",
signinAPI: "../../signin",
signoutUrl: "../../signout"
// GN5 configuration
// signinAPI: "../../api/user/signin",
// signoutUrl: "../../api/user/signout"
},
page: {
enabled: true,
Expand Down Expand Up @@ -1838,8 +1842,11 @@
}
});

// login url for inline signin form in top toolbar
$scope.signInFormAction = "../../signin#" + $location.url();
// login url and form action with hash reference to the current page
$scope.signInFormLinkWithHash =
$scope.gnCfg.mods.authentication.signinUrl + "#" + $location.url();
$scope.signInFormActionWithHash =
$scope.gnCfg.mods.authentication.signinAPI + "#" + $location.url();

// when the login input have focus, do not close the dropdown/popup
$scope.focusLoginPopup = function () {
Expand Down
1 change: 0 additions & 1 deletion web-ui/src/main/resources/catalog/js/LoginController.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@
$q,
gnLangs
) {
$scope.formAction = "../../signin#" + $location.url();
$scope.registrationStatus = null;
$scope.sendPassword = false;
$scope.password = null;
Expand Down
2 changes: 1 addition & 1 deletion web-ui/src/main/resources/catalog/templates/signin.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ <h1 data-translate="">loginTitle</h1>
<form
class="form-horizontal"
name="gnSigninForm"
action="{{formAction}}"
action="{{signInFormActionWithHash}}"
method="post"
role="form"
data-ng-if="::user"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
<span
data-ng-hide="user"
data-translate=""
data-translate-values="{signInFormAction: '{{signInFormAction}}', csrf: '{{csrf}}', redirectUrlAfterSign: '{{redirectUrlAfterSign}}'}"
data-translate-values="{signInFormAction: '{{signInFormLinkWithHash | signInLink}}}', csrf: '{{csrf}}', redirectUrlAfterSign: '{{redirectUrlAfterSign}}'}"
>
trySignIn
</span>
Expand Down
Loading