https://supertokens.com/ logo
Docs
Join the conversationJoin Discord
Channels
community
contributing
general
github-activity
info
introductions
new-releases
random
security
support-questions
welcome-0xdelusion
welcome-aj-ya
welcome-aleksandrc
welcome-alpinjs
welcome-amberlamps1
welcome-andrew-rodriguez
welcome-ankit-choudhary
welcome-anthony-stod-custodio
welcome-call-in
welcome-chwalbox
welcome-claybiokiller
welcome-co7e
welcome-cosmoecwsa
welcome-devdag
welcome-dinso
welcome-drebotelho
welcome-elio
welcome-ernest
welcome-foxbarrington
welcome-fromscratch
welcome-galto4ir
welcome-goetzum
welcome-hay-kot
welcome-himanshu-kukreja
welcome-hossambarakat
welcome-ichikawakazuto
welcome-jahir9991
welcome-jamesl
welcome-jerry123424
welcome-john-oliver
welcome-jonas-alexanderson
welcome-jxyz
welcome-kelvinwop
welcome-kraz
welcome-lancekey
welcome-leoo
welcome-lukeacollins
welcome-m-j-mon
welcome-malik-khoja
welcome-marco
welcome-mardadi
welcome-meshguy
welcome-metamorph
welcome-mike-tectu
welcome-mirzok
welcome-mozomig
welcome-naberyou66_
welcome-nacer
welcome-namratha
welcome-naveenkumar
welcome-nightlight
welcome-nischith
welcome-notankit
welcome-olawumi
welcome-pavan-kumar-reddy-n
welcome-pineappaul
welcome-poothebear
welcome-rick
welcome-samuel-qosenergy
welcome-samuelstroschein
welcome-shubhamgoel23
welcome-shubhamkaushal
welcome-sidebar
welcome-surajsli
welcome-suyash_
welcome-syntaxerror
welcome-tauno
welcome-tauno
welcome-tawnoz
welcome-teclali
welcome-tls
welcome-turbosepp
welcome-vikram_shadow
welcome-yann
Powered by Linen
support-questions
  • r

    rp

    12/08/2020, 2:57 PM
    Cool!
  • n

    nxteword

    12/08/2020, 2:59 PM
    Any estimates when we'll be able to use social logins?
  • r

    rp

    12/08/2020, 3:00 PM
    Sometime towards Jan end.
  • n

    nxteword

    12/08/2020, 3:00 PM
    Awesome.
  • r

    rp

    12/08/2020, 3:00 PM
    👍
  • r

    rp

    12/08/2020, 6:03 PM
    @User here is a repo that uses supertokens with vercel, nextjs and serverless functions: https://github.com/NkxxkN/supertokens-nextjs-demo
  • r

    rp

    12/08/2020, 6:03 PM
    for your reference ^
  • r

    rp

    12/08/2020, 6:04 PM
    thanks to @User
  • n

    nxteword

    12/08/2020, 6:04 PM
    Thanks a lot, will look into it.
  • n

    nxteword

    12/08/2020, 6:04 PM
    Thanks @User
  • k

    kevin.a

    12/08/2020, 6:04 PM
    If you have any question on the implementation @User do not hesitate to ping me 🙂
  • n

    nxteword

    12/08/2020, 6:04 PM
    Sure, thanks 😃
  • k

    kevin.a

    12/08/2020, 6:05 PM
    I'll write more guidelines in the following days and will let you know but that should be enough to get you started
  • n

    nxteword

    12/08/2020, 6:10 PM
    Yep, thanks a ton.
  • m

    Moere

    12/10/2020, 2:09 PM
    Is this no more valid
    TypeError: Cannot read property 'getUserId' of undefined
  • r

    rp

    12/10/2020, 2:10 PM
    Are you calling the session verify middleware in your route?
  • m

    Moere

    12/10/2020, 2:12 PM
    router.get(
      '/',
      supertokens.middleware(),
      roleAuthorization(['user', 'admin']),
      trimRequest.all,
      getApiKeys
    )
  • r

    rp

    12/10/2020, 2:12 PM
    Which version of SuperTokens-node is this?
  • m

    Moere

    12/10/2020, 2:14 PM
    "supertokens-node": "^3.1.0",
  • r

    rp

    12/10/2020, 2:14 PM
    So the function is Session.verifySession()
  • r

    rp

    12/10/2020, 2:15 PM
    The supertokens.middleware() goes in app.use()
  • m

    Moere

    12/10/2020, 2:15 PM
    I don't want the middleware for all routes
  • r

    rp

    12/10/2020, 2:15 PM
    the middleware is not going to add session verification for all routes
  • r

    rp

    12/10/2020, 2:15 PM
    it's going to automatically add the refresh API
  • r

    rp

    12/10/2020, 2:16 PM
    for routes that requires an active session, in those, you need to put:
    import Session from "supertokens-node/recipe/session"
    
    app.get("/", Session.verifySession(), ...);
  • m

    Moere

    12/10/2020, 2:22 PM
    very nice thanks! works
  • m

    Moere

    12/10/2020, 2:22 PM
    now only issue remaining is with sockets
  • m

    Moere

    12/10/2020, 2:22 PM
    that worked before
    io.use((socket, next) =>
          supertokens.middleware()(socket.request, socket.request.res, () => {
            next()
          })
        )
  • m

    Moere

    12/10/2020, 2:23 PM
    do i use here the verifySession aswell somehow?
  • r

    rp

    12/10/2020, 2:23 PM
    Yea for sockets, you should not be using session verification I think. You can initiate a socket connection after verifying a session, but the connection itself can be trusted
Powered by Linen
Title
r

rp

12/10/2020, 2:23 PM
Yea for sockets, you should not be using session verification I think. You can initiate a socket connection after verifying a session, but the connection itself can be trusted
View count: 4