zh Kooboo Logo Documents



The Account namespace is used for user authentication and login functionality
code for user login
let loginUser = k.account.login("username", "password");  
To ensure that only authenticated users can access certain parts of your application and redirect non-authenticated users
To get user information
let user= k.account.user.current; 
let org = k.account.organization.current; 
let usrDeparts = k.account.user.current.departments
let orgDeparts = k.account.organization.current.departments
To implement third-party login, such as Facebook login, you need to configure the App ID, Secret, and callback method in the system settings.
Here's an example of how you can implement Facebook login:
   <script env=server> 
       var url = k.oAuth2.facebook.getAuthUrl() 
   <a k-href='url'>facebook login</a>