diff options
| author | Pitu <[email protected]> | 2019-03-19 07:58:36 +0000 |
|---|---|---|
| committer | Pitu <[email protected]> | 2019-03-19 07:58:36 +0000 |
| commit | 107d1f4750e8f82a628b528c4ec200e918be271d (patch) | |
| tree | 0225bca3fd2a27e81b2ff711e53278cee890fdab /src/site/store | |
| parent | add restart at the end of update command (diff) | |
| download | host.fuwn.me-107d1f4750e8f82a628b528c4ec200e918be271d.tar.xz host.fuwn.me-107d1f4750e8f82a628b528c4ec200e918be271d.zip | |
API key WIP
Diffstat (limited to 'src/site/store')
| -rw-r--r-- | src/site/store/index.js | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/site/store/index.js b/src/site/store/index.js index 3c43f53..2f83f63 100644 --- a/src/site/store/index.js +++ b/src/site/store/index.js @@ -53,12 +53,13 @@ export const actions = { if (req.headers.cookie) { try { token = cookieparser.parse(req.headers.cookie).token; + console.log(token); commit('loggedIn', true); commit('token', token); - - const res = await axios.get(`${process.env.DOMAIN}${process.env.ROUTE_PREFIX}/verify`); - if (!res || !res.data.user); - commit('user', res.data.user); + const res = await axios.get(`${process.env.DOMAIN}${process.env.ROUTE_PREFIX}/verify`, { + headers: { authorization: `Bearer ${token}` } + }); + if (res && res.data.user) commit('user', res.data.user); } catch (error) { // TODO: Deactivate this on production console.error(error); |