How to use the @feathersjs/client.authentication function in @feathersjs/client

To help you get started, we’ve selected a few @feathersjs/client examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alltogethernow / web / src / modules / feathers-services.js View on Github external
import io from 'socket.io-client'
import feathers, { socketio, authentication } from '@feathersjs/client'

const socket = io(process.env.REACT_APP_API_SERVER, {
  transports: ['websocket'],
  forceNew: true,
})

const client = feathers()

client.configure(socketio(socket, { timeout: 10000 }))
client.configure(
  authentication({
    storage: window.localStorage,
    entity: 'user',
    service: 'users',
  })
)
// Try to prevent login timeouts although I don't think it actually works
// TODO: investigate how to fix this
client.service('authentication').timeout = 20000
client.service('users').timeout = 20000

export const channels = client.service('api/channels')
export const posts = client.service('api/posts')
export const search = client.service('api/search')
export const follows = client.service('api/follows')
export const micropub = client.service('api/micropub')
export const users = client.service('users')
github p3nt4 / Nuages / Clients / Nuages_Cli / app / nuagesAPI.js View on Github external
const feathers = require('@feathersjs/client');
const socketio = require('@feathersjs/socketio-client');
var path = require("path");
var fs = require("fs");
const io = require('socket.io-client');
var endpoint = process.argv[2] ? process.argv[2]  : "http://127.0.0.1:3030";
const socket = io(endpoint);
const term = require("./term").term;
const app = feathers();

var nuages = {};

app.configure(feathers.authentication({}));

app.configure(feathers.socketio(socket));
nuages.implantService = app.service('implants');
nuages.jobService = app.service('jobs');
nuages.fsService = app.service('fs');
nuages.fileService = app.service('/fs/files');
nuages.chunkService = app.service('/fs/chunks');
nuages.modrunService = app.service('/modules/run');
nuages.moduleService = app.service('/modules');
nuages.modloadService = app.service('/modules/load');
nuages.fsService.timeout = 20000000;
nuages.chunkService.timeout = 20000000;

nuages.vars = { 
    implants: {},
    paths:{},
github feathersjs-ecosystem / feathers-chat-react / src / feathers.js View on Github external
import io from 'socket.io-client';
import feathers from '@feathersjs/client';

const socket = io('http://localhost:3030');
const client = feathers();

client.configure(feathers.socketio(socket));
client.configure(feathers.authentication({
  storage: window.localStorage
}));

export default client;

@feathersjs/client

A module that consolidates Feathers client modules for REST (jQuery, Request, Superagent) and Websocket (Socket.io, Primus) connections

MIT
Latest version published 17 days ago

Package Health Score

90 / 100
Full package analysis