show message if user has no start-nodes

This commit is contained in:
Niels Lyngsø
2020-04-15 17:46:28 +02:00
parent b870ca7fcf
commit 61cb920808

View File

@@ -185,7 +185,19 @@ angular.module('umbraco.services')
authenticate: function (login, password) {
return authResource.performLogin(login, password)
.then(this.setAuthenticationSuccessful);
.then(function(data) {
// Check if user has a start node set.
if(data.startContentIds.length === 0 && data.startMediaIds.length === 0){
var errorMsg = "User has no start-nodes";
var result = { errorMsg: errorMsg, user: data, authenticated: false, lastUserId: lastUserId, loginType: "credentials" };;
eventsService.emit("app.notAuthenticated", result);
throw result;
}
return this.setAuthenticationSuccessful(data);
});
},
setAuthenticationSuccessful: function (data) {