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/16/2019, 7:10 AM
    Hello @everyone. If anyone is using the supertokens-website package, please be sure to use the latest released version - 3.2.9. It has fixes to critical bugs regarding sending custom headers to the backend + it’s compatibility with the browser-tabs-lock library.
  • r

    rp

    12/17/2019, 4:47 PM
    Anyone who has used our library so far, have you encountered a bug regarding development of a website on localhost but querying your API on a non-localhost URL?
  • b

    bustEXZ

    01/03/2020, 10:51 PM
    Hi there, can some one use supertokens with pasportjs (Oauth2) and express? I cant create express server without session as express-session, cookie-session and use only supertokens and use this with nextjs and SSR react
  • b

    bustEXZ

    01/03/2020, 10:55 PM
    This is bad, i think, two sessions at one application
  • r

    rp

    01/04/2020, 2:49 AM
    Hey @bustEXZ. You don’t need to use express sessions anymore. SuperTokens is a replacement for that. You can continue using passportJS
  • r

    rp

    01/04/2020, 5:17 AM
    along with express server
  • b

    bustEXZ

    01/04/2020, 9:09 AM
    @User Hi, thanks for reply. if i dont use session like this: this.app.use(cookieSession({ secret: process.env.SESSION_SECRET })); passport js drop server when start, with error -> req.session.authParams is not defined. because req.session not created. In supertokens documentation i dont find how to initiate this session with supertokens
  • r

    rp

    01/04/2020, 11:14 AM
    @bustEXZ, so you can create a middleware with SuperTokens that verifies a session and creates an object (and put that in req), that passport JS expects.
  • r

    rp

    01/04/2020, 11:19 AM
    If I end up writing an example of how this should work, I’ll surely share it here.
  • b

    bustEXZ

    01/04/2020, 12:31 PM
    @rp hm, i have middleware but for auth required routes. /auth route doesn't have this middleware, because we doesn't have sessions yet. where i can create this session object in req?
  • b

    bustEXZ

    01/04/2020, 12:36 PM
    if i add /auth route -> superTokenMiddleware
  • b

    bustEXZ

    01/04/2020, 12:36 PM
    with -> const session = await SuperTokens.getSession(req, res, false);
  • b

    bustEXZ

    01/04/2020, 12:37 PM
    getSession throw an error, and this is correct
  • r

    rp

    01/04/2020, 12:47 PM
    What is the error that getSession throws?
  • b

    bustEXZ

    01/04/2020, 12:48 PM
    with no user auth?
  • b

    bustEXZ

    01/04/2020, 12:48 PM
    SuperTokens.Error.UNAUTHORISED
  • b

    bustEXZ

    01/04/2020, 12:48 PM
    if i use this.app.use("/auth", superTokensMiddleware, AuthRouter);
  • b

    bustEXZ

    01/04/2020, 12:49 PM
    and const session = await SuperTokens.getSession(req, res, false); req.session = session as any; in middleware
  • r

    rp

    01/04/2020, 12:49 PM
    I see. And that still throws the passportJS error? Or does this work as expected?
  • b

    bustEXZ

    01/04/2020, 12:50 PM
    if i try to auth user with passport js auth
  • b

    bustEXZ

    01/04/2020, 12:51 PM
    because req.session was not created by anything
  • b

    bustEXZ

    01/04/2020, 12:51 PM
    TypeError: Cannot set property 'authParams' of undefined
  • r

    rp

    01/04/2020, 12:52 PM
    So now that u are creating req.session in the SuperTokens middleware, r u still getting req.session as undefined?
  • r

    rp

    01/04/2020, 12:53 PM
    After SuperTokens middleware has run
  • b

    bustEXZ

    01/04/2020, 12:53 PM
    if i do this: this.app.use("/auth", superTokensMiddleware, AuthRouter);
  • b

    bustEXZ

    01/04/2020, 12:53 PM
    and const session = await SuperTokens.getSession(req, res, false); req.session = session as any;
  • b

    bustEXZ

    01/04/2020, 12:53 PM
    this -> req.session = session as any; is not working, we going in catch
  • r

    rp

    01/04/2020, 12:53 PM
    Okay. So did u first create a new session?
  • b

    bustEXZ

    01/04/2020, 12:54 PM
    hm, empty?
  • b

    bustEXZ

    01/04/2020, 12:54 PM
    and after login push payload info into?
Powered by Linen
Title
b

bustEXZ

01/04/2020, 12:54 PM
and after login push payload info into?
View count: 4