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
general
  • u

    user

    06/19/2020, 8:55 PM
    Ohhh
  • u

    user

    06/19/2020, 8:55 PM
    I added the key to the root of my server
  • r

    rp

    06/19/2020, 8:56 PM
    I see. You should checkout this link if you haven't: https://github.com/supertokens/supertokens-docker-postgresql
  • r

    rp

    06/19/2020, 8:57 PM
    It contains the instructions on how to run the docker image you are running
  • r

    rp

    06/19/2020, 8:58 PM
    docker run \
        -p 3567:3567 \
        -e LICENSE_KEY_ID=yourLicenseKeyID \
        -d supertokens/supertokens-postgresql
  • r

    rp

    06/19/2020, 8:58 PM
    the above should start the container with the in memory db.
  • u

    user

    06/19/2020, 9:30 PM
    Gotcha
  • s

    Sun Walker

    06/20/2020, 3:16 AM
    Why does
    COOKIE_SECURE=true
    make supertokens always throw 440 on docker?
  • s

    Sun Walker

    06/20/2020, 3:17 AM
    Ohh that's https
  • r

    rp

    06/20/2020, 5:33 AM
    @User yup. COOKIE_SECURE=true means that the cookies will only be send to your nodejs APIs when you are using https. If not using https, no session cookies will go through resulting in session timeout
  • s

    Sun Walker

    06/20/2020, 1:01 PM
    Why does cookie_domain only work with
    COOKIE_DOMAIN=127.0.0.1
    on Docker? I thought 127.0.0.1 was a loopback address that means 'this container' 0.0.0.0 doesnt work, local ip 192... doesn't work nor does the name of the service in the Docker network. Only 127.0.0.1?
  • r

    rp

    06/20/2020, 3:56 PM
    what is the address of your APIs? is it http://127.0.0.1 ?
  • s

    Sun Walker

    06/20/2020, 6:52 PM
    It's running on docker at http://0.0.0.0:4000
  • s

    Sun Walker

    06/20/2020, 6:53 PM
    But it can be accessed by name by other docker services like http://name:4000/
  • s

    Sun Walker

    06/20/2020, 6:53 PM
    but neither of these work for
    COOKIE_DOMAIN
    only 127.0.0.1
  • r

    rp

    06/21/2020, 3:56 AM
    no i mean what is the URL that's in your react native app to access your APIs?
  • r

    rp

    06/21/2020, 4:45 AM
    @User , let me try and explain what cookie_domain is. Basically, you have a client (your react native app) and your server (your nodejs APIs). Your nodejs APIs are accessible via some URL. In your local dev environment, that URL can be http://127.0.0.1:400 or http://localhost:400. In your production environment, that URL is https://yourdomain.com. Now, cookie_domain is a feature that answers the following question for the client (your react native app) - "I am about to send a request to https://abc.com, for each cookie I have in my storage, which ones do I send?" In this case, only cookies that have the cookie_domain as "abc.com" will get sent. So likewise, if in your dev environment, if your nodejs APIs are accessable via http://127.0.0.1:4000, then only cookies with the cookie_domain as "127.0.0.1" will get sent to it.
  • s

    Sun Walker

    06/21/2020, 12:30 PM
    Brilliant explanation @User really helpful
  • r

    rp

    06/21/2020, 2:50 PM
    👍
  • u

    user

    06/22/2020, 6:49 PM
    If I have a user that's signed up already, how do I fetch the session information? Or do I need to create a new one everytime?
  • u

    user

    06/22/2020, 6:49 PM
    So do I need to do
    await supertokens.createNewSession(res, userObj.objectId, jwtPayload, {})
    everytime a user logs in?
  • r

    rp

    06/22/2020, 6:52 PM
    > If I have a user that's signed up already, how do I fetch the session information? Or do I need to create a new one everytime? In the sign up API, you will have to create a new session, and then in subsequent APIs, you will have to use our middleware to verify sessions. > So do I need to do await supertokens.createNewSession(res, userObj.objectId, jwtPayload, {}) everytime a user logs in? Yes. Cause logging in means you verify the credentials, and then create a new session.
  • u

    user

    06/22/2020, 8:28 PM
    TypeError: Cannot read property 'hostname' of undefined
  • u

    user

    06/22/2020, 8:28 PM
    Getting this error…
  • r

    rp

    06/22/2020, 8:29 PM
    Can I please see your code for the init function?
  • u

    user

    06/22/2020, 8:29 PM
    supertokens.init({ hosts: process.env.SUPERTOKEN_HOST })
  • u

    user

    06/22/2020, 8:29 PM
    SUPERTOKEN_HOST is a string
  • r

    rp

    06/22/2020, 8:30 PM
    oh right. Seeing what the issue is. What version of the node lib are you using?
  • u

    user

    06/22/2020, 8:32 PM
    "supertokens-node": "^2.0.2"
  • r

    rp

    06/22/2020, 8:33 PM
    ah i see. So, you are seeing the docs for version 2.1.X, but using version 2.0.X
Powered by Linen
Title
r

rp

06/22/2020, 8:33 PM
ah i see. So, you are seeing the docs for version 2.1.X, but using version 2.0.X
View count: 2