Hey Community,
I'm trying to log out a user through JS.Is there way to do it ?
I'm aware that the db of the usersession can be updated, but it does bring a popup to the screen.Is there a workaround?
eg :
if ( some condition)
{ some custom function
}
else
{ log the user out.
}
I did it check out this article, but unsure as to how to implement it
https://community.creatio.com/questions/how-logout-user-after-checking-…
Like
Hi,
Yes, you can call
Terrasoft.MainMenuUtilities.logout();
to logout the user. You can even test it in the developer console in the browser (just execute this line in the console).
As for how to use it - depends on your business task. You can call this logout method as a button click handler or using any other conditions suitable.
Hi,
Yes, you can call
Terrasoft.MainMenuUtilities.logout();
to logout the user. You can even test it in the developer console in the browser (just execute this line in the console).
As for how to use it - depends on your business task. You can call this logout method as a button click handler or using any other conditions suitable.
Hi,
I need to make custom web-service to Logout External Applications that are connected with Creatio.
I found code that is below:
[OperationContract]
[WebInvoke(Method = "GET", UriTemplate = "Logout", ResponseFormat = WebMessageFormat.Json)]
public string Logout()
{
try
{
var userId = UserConnection.CurrentUser.Id;
new Delete(UserConnection)
.From("SysUserSession")
.Where("SysUserId").IsEqual(Column.Parameter(userId))
.Execute();
return $"{{\"success\": true, \"message\": \"User {userId} logged out.\"}}";
}
catch (Exception ex)
{
return $"{{\"success\": false, \"error\": \"{ex.Message}\"}}";
}
}
Above code is logging out Creatio itself not user of external application. So, Based on my understanding, I need to clear or invalid Cookies & Token that external application received through log-in service.
How can I logout the external application?