usehenri/henri

Add a defaultPage & securePage wrapper

reel opened this issue · 1 comments

reel commented

Add a component that would register REST and SocketIO, handle injected authentication token server-side and wrap the feathers app methods to enhance them. Similar to src/client/components/application.js in the example app.

import feathers from 'feathers/client';
import rest from 'feathers-rest/client';
import hooks from 'feathers-hooks';
import authentication from 'feathers-authentication-client';

import 'isomorphic-fetch';

const app = feathers()
// eslint-disable-next-line no-undef
  .configure(rest('http://localhost:3030').fetch(fetch))
  .configure(hooks());

if (process.browser) {
  app.configure(authentication({
    storage: window.localStorage
  }));
}

export default (Page) => <Page {...this.props} app={app} />;

Or a full class. I will add some more info later on.

reel commented

closed by f78022d