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

    07/20/2021, 1:43 PM
    you can change the
    resetPasswordFeature
    style in the config change the style?
  • u

    user

    07/20/2021, 3:20 PM
    hi guys, question on self hosting the supertokens core. how is the memory usage? I plan on running this on ec2 t3 micro alongside postgres + an express backend. would it be sufficient?
  • r

    rp

    07/20/2021, 3:26 PM
    Usually the core uses 300-400 mb RAM at rest (thanks to the JVM). On heavy load (250rps), it can go up to 500 mb. If you deploy 5 of these instances and put a load balancer in front, you can easily achieve 1000rps consistently. The thread pool size should be equal to the number of (virtual) cores in the ec2 instance
  • u

    user

    07/20/2021, 3:27 PM
    oh no, I probably won't need that many rps and scale horizontally
  • u

    user

    07/20/2021, 3:27 PM
    thanks for the info
  • r

    rp

    07/20/2021, 3:27 PM
    cool!
  • r

    rp

    07/20/2021, 3:28 PM
    you can also limit the heap size (when running our start command) to reduce the 250 mb usage. See https://supertokens.io/docs/thirdpartyemailpassword/common-customizations/cli/start
  • r

    rp

    07/20/2021, 4:28 PM
    @User , to answer your question in more detail, you can have a look at this: https://supertokens.io/docs/auth-react/emailpassword/config/reset-password Specifically, try to use the
    submitNewPasswordForm
    >
    style
    object.
  • s

    sahil-shubham

    07/20/2021, 8:02 PM
    Hi @User , I have a function which I run on sign up/in. I currently make it run by checking if
    context.action === "SUCCESS"
    , now I also want to run this function on logout event, how can I go about doing that?
  • r

    rp

    07/20/2021, 8:03 PM
    which version of the node SDK are you using?
  • s

    sahil-shubham

    07/20/2021, 8:04 PM
    I am doing it in the frontend, should have mentioned that.
  • s

    sahil-shubham

    07/20/2021, 8:04 PM
    supertokens-auth-react: ^0.14.1
  • s

    sahil-shubham

    07/20/2021, 8:05 PM
    supertokens-node: ^5.0.1
  • r

    rp

    07/20/2021, 8:06 PM
    ah right.. on the frontend, you want to override the signOut function mentioned here: https://supertokens.io/docs/auth-react/0.14.X/session/override/functions
  • r

    rp

    07/20/2021, 8:07 PM
    This is how it's done: https://supertokens.io/docs/thirdpartyemailpassword/advanced-customizations/frontend-functions-override/usage
  • s

    sahil-shubham

    07/20/2021, 8:07 PM
    I followed this for adding a function post sign up/in: https://supertokens.io/docs/thirdpartyemailpassword/common-customizations/handling-signinup-success
  • s

    sahil-shubham

    07/20/2021, 8:08 PM
    Added it inside a onHandleEvent in init
  • r

    rp

    07/20/2021, 8:10 PM
    Yea so in the version of the SDK that you are using, there is no sign out event (it's there in the 0.15.X though. So in your version, you can capture that by using the override feature in session.init and overriding the signOut function
  • s

    sahil-shubham

    07/20/2021, 8:11 PM
    Okay, so upgrading to the 0.15.X isn't recommended?
  • r

    rp

    07/20/2021, 8:11 PM
    oh.. you can! for sure..
  • r

    rp

    07/20/2021, 8:12 PM
    and then there is a sign out event that's fired as mentioned here: https://supertokens.io/docs/session/advanced-customizations/frontend-hooks/handle-event
  • s

    sahil-shubham

    07/20/2021, 8:14 PM
    Got it. So I upgrading to 0.15.0, do I have to upgrade supertokens-node to a newer version too?
  • r

    rp

    07/20/2021, 8:14 PM
    nope
  • s

    sahil-shubham

    07/20/2021, 8:15 PM
    Understood, thank you for quick response.
  • s

    sahil-shubham

    07/20/2021, 8:27 PM
    The function doesn't run on adding
    context.action === "SIGN_OUT"
    , I have upgraded supertokens-auth-react to 0.15.0.
  • r

    rp

    07/20/2021, 8:31 PM
    Can I see the full init code please?
  • s

    sahil-shubham

    07/20/2021, 8:33 PM
    message has been deleted
  • r

    rp

    07/20/2021, 8:34 PM
    right.. the SIGN_OUT event is fired in the Session.init()
  • s

    sahil-shubham

    07/20/2021, 8:34 PM
    All I have done is added an OR statement.
  • s

    sahil-shubham

    07/20/2021, 8:34 PM
    Oh, okay. Why two different places?
Powered by Linen
Title
s

sahil-shubham

07/20/2021, 8:34 PM
Oh, okay. Why two different places?
View count: 3