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

    JadBlackstone

    04/06/2022, 2:30 PM
    Thank you! 😄
  • d

    Dhr_RT

    04/06/2022, 8:53 PM
    Hello, I am running Node Express, and when following the Quick setup I am unable to have the nodeJs bundle (via esbuild) and run correctly. My root file is listed as server.ts - and in that one I have setup the 'supertokens.init` function. But I am getting this error
  • k

    KalibCheil

    04/06/2022, 9:00 PM
    I had the same issue. I solved adding Session.init() in the recipelist in the supertokens.init
  • d

    Dhr_RT

    04/06/2022, 9:02 PM
    This is mine atm
  • d

    Dhr_RT

    04/06/2022, 9:03 PM
    Did you have a different order of functions?
  • k

    KalibCheil

    04/06/2022, 9:03 PM
    no, but my connectionURI is different
  • d

    Dhr_RT

    04/06/2022, 9:03 PM
    This is listed as the demo one - but I'll attempt to change that
  • d

    Dhr_RT

    04/06/2022, 9:03 PM
    moment
  • d

    Dhr_RT

    04/06/2022, 9:07 PM
    Still getting the error
  • d

    Dhr_RT

    04/06/2022, 9:08 PM
    I am going to recheck the setup steps
  • k

    KalibCheil

    04/06/2022, 9:08 PM
    I am using the db that supertokens provide us when you create an user
  • k

    KalibCheil

    04/06/2022, 9:13 PM
    message has been deleted
  • d

    Dhr_RT

    04/06/2022, 9:14 PM
    I see you encapsulated it inside a function, why and where would you trigger it?
  • k

    KalibCheil

    04/06/2022, 9:14 PM
    in the main file
  • d

    Dhr_RT

    04/06/2022, 9:15 PM
    Ah I see 😉
  • d

    Dhr_RT

    04/06/2022, 9:15 PM
    And you are also compiling via esbuild?
  • d

    Dhr_RT

    04/06/2022, 9:16 PM
    message has been deleted
  • d

    Dhr_RT

    04/06/2022, 9:17 PM
    To me it seems that my out.js is executing code in a different order then desired by the supertoken code
  • k

    KalibCheil

    04/06/2022, 9:19 PM
    This is my main file (index.js). I am using express and this is where I am calling the supertokens.init
  • d

    Dhr_RT

    04/06/2022, 9:28 PM
    No success yet
  • d

    Dhr_RT

    04/06/2022, 9:36 PM
    Making progress here
  • d

    Dhr_RT

    04/06/2022, 9:45 PM
    @KalibCheil Thanks, I think I am passed the hurdle here
  • d

    Dhr_RT

    04/06/2022, 9:50 PM
    Fix for me was to execute the superTokenInit() on the same file as I have all the app.use commands. In my app this is the 2nd file
  • r

    rp

    04/07/2022, 3:57 AM
    Thanks for the help @User ! Appreciate it 🙂
  • y

    yyogeshwar

    04/07/2022, 4:16 AM
    When running code from docker i am getting this error , do we need to expose some ports , otherwise working fine for normal local version
    r
    33 replies · 2 participants
  • y

    yyogeshwar

    04/07/2022, 4:17 AM
    "statusCode": 500,
      "error": "Internal Server Error",
      "message": "getaddrinfo ENOTFOUND f487f461b440b2b480-ap-southeast-1.aws.supertokens.io"
  • e

    Embraser01

    04/07/2022, 6:59 AM
    Hi, is there a way to make the supertokens core log in a JSON format? Currently, it's really hard to go through these logs as there is always a useless line of log + a single line of data.
  • r

    rp

    04/07/2022, 7:08 AM
    @User there isn't a way to do that at the moment
  • z

    zenbug

    04/07/2022, 9:40 AM
    Hey guys, did someone of you successfully implemented SuperTokens into django rest framework? We're struggling with the api view implementation, where
    @verify_session()
    comes into play.
    r
    13 replies · 2 participants
  • a

    ankitmhn

    04/07/2022, 10:01 AM
    Hello all, how can I add metadata to my users? For a SaaS app I want to be able to add an orgId as well as role. I thought I had found something for role but can't seem to find it again
    r
    4 replies · 2 participants
Powered by Linen
Title
a

ankitmhn

04/07/2022, 10:01 AM
Hello all, how can I add metadata to my users? For a SaaS app I want to be able to add an orgId as well as role. I thought I had found something for role but can't seem to find it again
r

rp

04/07/2022, 10:03 AM
Hey! We have APIs exposed by the core for adding user metadata: https://app.swaggerhub.com/apis/supertokens/CDI/2.13.0#/User%20Metadata%20Recipe The backend SDKs have not been updated yet to add helper functions around these APIs, but you can call them directly using axios or node-fetch.
a

ankitmhn

04/07/2022, 10:13 AM
So, what does the workflow look like with this? I'm using EmailPassword recepie. The user signsup on the frontend (I also need to be able to invite users from within the app, but that is for later). I then attach the metadata using the userId from the backend. How does the frontend then get the metadata?
Would the getUserInfo provide the user metadata?
r

rp

04/07/2022, 10:22 AM
The backend can retrieve the metadata for the userId using the API from the above spec, and you can send that to the frontend in a couple of ways: - Create an API on the backend that verifies the user's session -> gets the user id -> queries the core to get the meta data -> send it to the frontend; OR - Store the metadata in the access token's payload and retrieve that on the frontend without an API call. The downside to this approach is that the access token's side increases to contain whatever you are putting in it, so use this method only if you need to get the metadata often on the frontend.
View count: 6