MCPcopy Index your code
hub / github.com/pythonstock/stock / login

Function login

frontend/src/store/modules/user.js:32–44  ·  view source on GitHub ↗
({ commit }, userInfo)

Source from the content-addressed store, hash-verified

30const actions = {
31 // user login
32 login({ commit }, userInfo) {
33 const { username, password } = userInfo
34 return new Promise((resolve, reject) => {
35 login({ username: username.trim(), password: password }).then(response => {
36 const { data } = response
37 commit('SET_TOKEN', data.token)
38 setToken(data.token)
39 resolve()
40 }).catch(error => {
41 reject(error)
42 })
43 })
44 },
45
46 // get user info
47 getInfo({ commit, state }) {

Callers

nothing calls this directly

Calls 2

setTokenFunction · 0.90
resolveFunction · 0.85

Tested by

no test coverage detected