Hello, a little help for a newbie with a Umbraco plugin development. I hope some one out there can help me,
I'm developing plugin frontend with angularjs. My application logic depends on backend user. If user loged in I must show one form, if user loged out I must show other form.
I can get current user this way:
Asp.Net MVC controller action:
[HttpGet]
public IHttpActionResult GetCurrentUser()
{
var userTicket = new HttpContextWrapper(HttpContext.Current).GetUmbracoAuthTicket();
if (userTicket != null)
{
IUser currentUser = ApplicationContext.Services.UserService.GetByUsername(userTicket.Name);
return Ok(new UserViewModel(currentUser));
}
return Ok();
}
In angular service can take user:
function getCurrentUser() {
var url = '/umbraco/api/UserApi/GetCurrentUser';
return $http.get(url).then(handleSuccess, handleError('Error getting current user'));
}
Ok, I can get information about user, but I can't get an event when this user log out. I doesn't want to use polling in this case. Maybe there is a better soliution?
Backoffice user login/logout event in plugin frontend
Hello, a little help for a newbie with a Umbraco plugin development. I hope some one out there can help me,
I'm developing plugin frontend with angularjs. My application logic depends on backend user. If user loged in I must show one form, if user loged out I must show other form.
I can get current user this way:
Asp.Net MVC controller action:
In angular service can take user:
Ok, I can get information about user, but I can't get an event when this user log out. I doesn't want to use polling in this case. Maybe there is a better soliution?
is working on a reply...