apollo-auth

Authentication module for Apollo

Usage no npm install needed!

<script type="module">
  import apolloAuth from 'https://cdn.skypack.dev/apollo-auth';
</script>

README

apollo-auth

Authentication module for Apollo

Public Methods

Actions

getUserData fetch the logged in user object from the server

import { getUserData } from 'apollo-auth/dist/client/actions';

Usage

Reducer

import user from 'apollo-auth/dist/client/reducer';

const rootReducer = combineReducers({
    user
});

Routes

import AuthRoutes from 'apollo-auth/dist/client/routes';

const routes = (
    <Route component={App}>
        {AuthRoutes}
    </Route>
);