MCPcopy Create free account
hub / github.com/apache/cloudstack / login

Function login

ui/src/api/index.js:86–108  ·  view source on GitHub ↗
(arg)

Source from the content-addressed store, hash-verified

84}
85
86export function login (arg) {
87 if (!sourceToken.checkExistSource()) {
88 sourceToken.init()
89 }
90
91 // Logout before login is called to purge any duplicate sessionkey cookies
92 postAPI('logout')
93
94 const params = new URLSearchParams()
95 params.append('command', 'login')
96 params.append('username', arg.username || arg.email)
97 params.append('password', arg.password)
98 params.append('domain', arg.domain)
99 params.append('response', 'json')
100 return axios({
101 url: '/',
102 method: 'POST',
103 data: params,
104 headers: {
105 'content-type': 'application/x-www-form-urlencoded'
106 }
107 })
108}
109
110export async function logout () {
111 const result = await postAPI('logout').finally(() => {

Callers 1

LoginFunction · 0.90

Calls 3

postAPIFunction · 0.85
initMethod · 0.65
appendMethod · 0.45

Tested by

no test coverage detected