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
  • b

    Bosky

    10/29/2020, 12:40 PM
    i had to add the catch
  • r

    rp

    10/29/2020, 12:40 PM
    if you are using await, you can surround with try and catch
  • b

    Bosky

    10/29/2020, 12:42 PM
    ok this seems better
    let session = await supertokens.getSession(req, res, true).catch(er => null);
        if(!session){ return redirect(); }
  • r

    rp

    10/29/2020, 12:43 PM
    try {
      let session = await supertokens.getSession(req, res, true)
    } catch (err) {
     if (err.errType === supertokens.Error.UNAUTHORISED) {
        redirect
      }
    }
  • r

    rp

    10/29/2020, 12:46 PM
    @User , most of the queries you have can be answered via the node js docs: https://supertokens.io/docs/nodejs/usage-with-express/user-login
  • b

    Bosky

    10/30/2020, 7:51 AM
    am getting this error today, right after init
    Error: No SuperTokens core available to query
  • r

    rp

    10/30/2020, 7:57 AM
    Can you please send your init code?
  • r

    rp

    10/30/2020, 7:57 AM
    cause your server is working
  • n

    nxteword

    12/08/2020, 11:09 AM
    Hey rp, can I use supertokens with next framework hosted on vercel serverless functions and mongodb database?
  • r

    rp

    12/08/2020, 11:10 AM
    Hey @nxteword do you want to use the login feature or just session management?
  • r

    rp

    12/08/2020, 11:11 AM
    Because for login, it only works MySQL and PostgreSQL at the moment
  • r

    rp

    12/08/2020, 11:11 AM
    Whilst session works with mongo as well
  • n

    nxteword

    12/08/2020, 11:14 AM
    Can you please point me to resources to learn about login and session and if I use session from you, how will I be able to implement login on my own? I know only a little bit about auth, I researched on web and using JWT and storing in a httponly cookie and doing refresh token implementation seems to be a good solution, I was wondering how that would go with supertokens, thanks.
  • n

    nxteword

    12/08/2020, 11:16 AM
    If I were to implement user management (Login), when you guys introduce it for mongodb, will I be able to move users onto supertokens?
  • n

    nxteword

    12/08/2020, 11:17 AM
    Again I'm sorry if the questions sound wrong.
  • r

    rp

    12/08/2020, 11:23 AM
    Before I answer that question, one more question for you. Are you OK with using our managed service? Or do you definitely only want to use the self hosted version.
  • r

    rp

    12/08/2020, 11:29 AM
    If you are OK with using the managed service, then you can use login + sessions since we store the data as well.
  • n

    nxteword

    12/08/2020, 11:32 AM
    I think I'm okay with managed service as well since I'm planning to use it to a new side project
  • r

    rp

    12/08/2020, 11:33 AM
    Sounds good! Then you can follow our quick setup and you should be able to use login + sessions out of the box. Now coming to your question about NextJS, do you have an API server too?
  • n

    nxteword

    12/08/2020, 11:39 AM
    I'm planning to build it on serverless functions on Vercel
  • r

    rp

    12/08/2020, 11:39 AM
    Using node under the hood?
  • n

    nxteword

    12/08/2020, 11:39 AM
    Yeah I think
  • r

    rp

    12/08/2020, 11:39 AM
    Do they allow you to add middlewares?
  • n

    nxteword

    12/08/2020, 11:40 AM
    They have express like syntax but I'm not sure if they use express under the hood
  • r

    rp

    12/08/2020, 11:40 AM
    Hmmmm.
  • r

    rp

    12/08/2020, 11:40 AM
    That might be an issue then
  • r

    rp

    12/08/2020, 11:40 AM
    Cause we work with express
  • r

    rp

    12/08/2020, 11:40 AM
    If they are compatible with express, it should be fine
  • n

    nxteword

    12/08/2020, 11:41 AM
    https://vercel.com/docs/serverless-functions/introduction
  • n

    nxteword

    12/08/2020, 11:41 AM
    Do you also have a solution for python?
Powered by Linen
Title
n

nxteword

12/08/2020, 11:41 AM
Do you also have a solution for python?
View count: 1