FRONT const actions getAuthVk async commit const data await Axios get

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
// FRONT
const actions = {
getAuthVk: async ({commit}) => {
const {data} = await Axios.get('http://localhost:3001/', {
withCredentials: true
})
console.log(data)
}
}
// BACK
app.get('/', function(req, res) {
const user = req.session.passport.user
res.send({
user: user
});
console.log(user)
});