Giter VIP home page Giter VIP logo

ts-sequelize-example's People

Watchers

 avatar  avatar

ts-sequelize-example's Issues

How can your access to session data typescript compile...

Hi @arbassic , thank you for publishing your example.

I am working with node/typescript and express

I looked up desperately google and github, to find a way to read/write data to my http session (I am using package express-session, like you and many) :

  • when I console.log(req.session), I see data like :
---------------------------------------
 Express Session is : 
Session {
  cookie: { path: '/', _expires: null, originalMaxAge: null, httpOnly: true },
  passport: {
    user: {
      github_profile: [Object],
      github_access_token: '9838d3c2a8817e393fa673d43f70b602b2a9bdc8'
    }
  }
}
---------------------------------------
^C
jbl@poste-devops-jbl-16gbram:~/hugo-cheatsheet$ tsc
src/server/permissions/pokus/github/index.ts:29:31 - error TS2339: Property 'passport' does not exist on type 'Session & Partial<SessionData>'.

29       console.log(req.session.passport)
                                 ~~~~~~~~


Found 1 error.
  • and in TypeScript, as you can see, If I try to req.session.passport or req.session["passport"], then my compiler of course gives me an error...
  • How can I access those properties which I know are there, really could not find one example anywhere...
  • and even worse : I git cloned you project, and it perfectly compiles!... I have same tsconfig.json than you in my project! .... This is killing me ...
  • Was hoping with your nice work here,you could tell me what am I doing wrong, here...

Here is my source code :

Would you have any tip on how to do that ..?

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.