GithubHelp home page GithubHelp logo

Comments (8)

lefnire avatar lefnire commented on May 24, 2024

hm, can't reproduce - try again, there were some changes recently. make sure your server.js file matches the example app, which was also recently changed. if still buggy, re-open

from derby-auth.

acertain avatar acertain commented on May 24, 2024

I'm not using that, but a minimal one from the README:

express = require 'express'
derby = require 'derby'
racer = require 'racer'

strategies =
  google:
    strategy: require('passport-google').Strategy
    conf:
      clientId: process.env.GOOGLE_KEY
      clientSecret: process.env.GOOGLE_SECRET
      returnURL: '/'
options =
  domain: 'http://localhost:3000'
  allowPurl: true

derby.use(derby.logPlugin)
racer.use(racer.logPlugin)

expressApp = express()
server = require('http').createServer expressApp

# The server-side store syncs data over Socket.IO
store = derby.createStore listen: server

expressApp
  .use(express.static __dirname + '/public')
  .use(store.modelMiddleware())
  .use(require('derby-auth')(store, strategies, options))
  .use(require('./hello').router())

server.listen 3000

from derby-auth.

lefnire avatar lefnire commented on May 24, 2024

git the latest push a shot, a3da0e6

from derby-auth.

lefnire avatar lefnire commented on May 24, 2024

You know what, I hit this issue too just recently - and there was no reason it should have been happening, so I just ran rm -rf node_modules/* && npm install and it seemed ok... strange.

from derby-auth.

acertain avatar acertain commented on May 24, 2024

No cigar, using git.

from derby-auth.

acertain avatar acertain commented on May 24, 2024

I made some changes to my server.js and it works:

express = require 'express'
derby = require 'derby'
racer = require 'racer'

strategies =
  google:
    strategy: require('passport-google').Strategy
    conf:
      clientId: process.env.GOOGLE_KEY
      clientSecret: process.env.GOOGLE_SECRET
      returnURL: '/'
options =
  domain: 'http://localhost:3000'
  allowPurl: true

derby.use(derby.logPlugin)
racer.use(racer.logPlugin)

expressApp = express()
server = require('http').createServer expressApp

# The server-side store syncs data over Socket.IO
store = derby.createStore listen: server

expressApp
  .use(express.favicon())
  .use(require('gzippo').staticGzip(__dirname + '/public'))
  .use(express.compress())
  .use(express.cookieParser()) 
  .use(store.sessionMiddleware
    secret: process.env.SESSION_SECRET || 'default_secret'
    cookie: {maxAge: 1000 * 60 * 60 * 24 * 365}
  )
  .use(store.modelMiddleware())
  .use(require('derby-auth')(store, strategies, options))
  .use(require('./hello').router())

server.listen 3000

from derby-auth.

ile avatar ile commented on May 24, 2024

Had the same issue, uncommented these uses and it started working (at least got through this issue)

  # Uncomment and supply secret to add Derby session handling
  # Derby session middleware creates req.session and socket.io sessions
  .use(express.cookieParser())
  .use(store.sessionMiddleware
    secret: process.env.SESSION_SECRET || 'YOUR SECRET HERE'
    cookie: {maxAge: ONE_YEAR}
  )

Does this need to be added to the documentation?

Thanks for the derby-auth btw.

from derby-auth.

lefnire avatar lefnire commented on May 24, 2024

oh those are definitely required, i'll add them to the documentation

from derby-auth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.