Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

authentication - Method: remove #662

Closed
Terran47 opened this Issue Apr 12, 2018 · 1 comment

Comments

Projects
None yet
2 participants
@Terran47
Copy link

Terran47 commented Apr 12, 2018

Steps to reproduce

Good afternoon, tell me how to make sure that the session is not interrupted? After 5 minutes of inactivity, authorization removed, and I can not make requests without errors


app.js
const path = require('path');
const favicon = require('serve-favicon');
const compress = require('compression');
const cors = require('cors');
const helmet = require('helmet');
const bodyParser = require('body-parser');

const feathers = require('feathers');
const configuration = require('feathers-configuration');
const hooks = require('feathers-hooks');
const rest = require('feathers-rest');
const socketio = require('feathers-socketio');

const handler = require('feathers-errors/handler');
const notFound = require('feathers-errors/not-found');

const middleware = require('./middleware');
const services = require('./services');
const appHooks = require('./app.hooks');

const sequelize = require('./sequelize');
const easyimg = require('easyimage');

const authentication = require('./authentication');

var fs = require('fs');
const app = feathers();

// Load app configuration
app.configure(configuration());
// Enable CORS, security, compression, favicon and body parsing
app.use(cors());
app.use(helmet());
app.use(compress());
app.use(bodyParser.json({
limit: '50mb'
}));
app.use(bodyParser.urlencoded({ extended: true }));
app.use(favicon(path.join(app.get('public'), 'favicon.ico')));
// Host the public folder
app.use('/', feathers.static(app.get('public')));

// Set up Plugins and providers
app.configure(hooks());
app.configure(sequelize);
app.configure(rest());
app.configure(socketio({
pingInterval:1000000,
pingTimeout:50000000
}));

// Configure other middleware (see middleware/index.js)
app.configure(middleware);
app.configure(authentication);
// Set up our services (see services/index.js)
app.configure(services);
// Configure a middleware for 404s and the error handler
app.use(notFound());
app.use(handler());

app.hooks(appHooks);

module.exports = app;

Android
Module versions (especially the part that's not working):

NodeJS version:

**Operating SystemCentos 6:

**React Native Version0.50:

Module Loader:

@daffl

This comment has been minimized.

Copy link
Member

daffl commented Apr 15, 2018

Try forcing the websocket transport on the Socket.io client connection:

const socket = io('http://api.my-feathers-server.com', {
  transports: ['websocket'],
  forceNew: true
});

@daffl daffl closed this Apr 19, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.