Added cookie to indicate logged in status

This commit is contained in:
Jori Lallo
2017-10-11 00:14:45 -07:00
parent 4dacef7f1e
commit 42ed9616b5
6 changed files with 48 additions and 21 deletions

View File

@@ -1,6 +1,7 @@
// @flow
import { observable, action, computed, autorunAsync } from 'mobx';
import invariant from 'invariant';
import Cookie from 'js-cookie';
import { client } from 'utils/ApiClient';
import type { User, Team } from 'types';
@@ -33,6 +34,7 @@ class AuthStore {
@action logout = () => {
this.user = null;
this.token = null;
Cookie.remove('loggedId', { path: '/' });
};
@action getOauthState = () => {

View File

@@ -52,6 +52,7 @@ class ApiClient {
body,
headers,
redirect: 'follow',
credentials: 'include',
});
// Handle request promises and return a new promise