I have create some views and use login and logout option by adding some script
for login I bind to label text I use this {session.props.auth.user.userName}
for logout
if self.session.props.auth.authenticated:
system.perspective.logout()
else:
system.perspective.login()
Now the problem is if I am not working on the screen after some time automatically showing “null” in the login user name that I display userName on label
What is the meaning of this Null in login?
How we can avoid this?
Can we make it automatically logout if user is not use the launch screen for sometime or user not use screen for longer duration?
When the username is null it means that there is no user logged in. I usually override null and display something like ‘guest’ instead.
You can set the auto logout from the project properties. Just note that while it will log the user out, the idp may still remember the login and clicking login again will then auto login the last user. You can avoid that by setting an option I believe in the idp settings, I can’t remember off the top of my head
Hello,
Did not solve my problem,
I can access all screen component on launch window but still login showing user name as null. so can we make automatic logout after some time if user is not use the launch screen
If the user is null, there’s no logout to do. You should be inspecting your page and view designs to ensure you’ve required security where you need it. Perspective allows anonymous users unless you add restrictions.
If you don’t want users to have access to your app at all without logging in, use the project properties to deny unauthenticated access. Otherwise, do as Phil said and disable actions on your View components based on roles/etc for example using the hasRole(...) function