From Bright Pattern Documentation
Jump to: navigation, search
• 5.19


getLoginState

Receive the login state, session and agent ID if user authorized.

Request

Syntax

getLoginState(): Promise<OperationResult<LoginStateData>>

Where:

type LoginStateData = {

   isLoggedIn: boolean

   agentId?: string

   username?: string

   sessionId?: string

}

Parameters

(None)

Example Request

   getLoginStateButton.onclick = () => {

       adApi.getLoginState()

   }

Return Value

Object Object Values Data Type Optional?

(Y/N)

Return Value Description
LoginStateData
isLoggedIn Boolean N If the value is true, the agent is logged in; if the value is false the agent is not logged in.
agentId String Y If the requesting user has the appropriate privilege, this value returns the user’s agent ID.
username String Y If the requesting user has the appropriate privilege, this value returns the user’s username.
sessionId String Y If the requesting user has the appropriate privilege, this value returns the current session ID.
< Previous | Next >