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

    04/27/2021, 3:47 PM
    @User , we have an example for AWS lambda here: https://github.com/supertokens/supertokens-auth-react/tree/master/examples/with-aws-lambda We are still writing the docs for it which should be ready in 2-3 days.
  • u

    user

    04/27/2021, 6:05 PM
    wooooow awesome, guys! will check it out immediately! πŸ™Œ
  • u

    user

    04/27/2021, 6:32 PM
    1. does this example assume enabling CORS in the AWS APIG console with the
    credentials
    set to
    'true'
    and with adding the ST headers next to the default APIG headers? 2. does the
    /user
    endpoint serve as an example for a functional endpoint like, for instance,
    getTasks
    or
    createTask
    ?
  • r

    rp

    04/27/2021, 6:41 PM
    1. Yes. 2.yes.
  • r

    rp

    04/27/2021, 6:42 PM
    The example has adding CORS via the code which is not needed since you are doing it via the API gateway.
  • r

    rp

    04/27/2021, 6:42 PM
    It’s there in the example though cause it also serves as an example for if someone is not using the API gateway
  • u

    user

    04/27/2021, 6:43 PM
    so basically if APIG has enabled CORS one could skip
    app.use(
      cors({
        origin: "http://localhost:3000",
        allowedHeaders: ["content-type", ...supertokens.getAllCORSHeaders()],
        credentials: true,
        methods: ["GET", "PUT", "POST", "DELETE", "OPTIONS"],
      }),
    )
    ?
  • r

    rp

    04/27/2021, 6:43 PM
    Yes
  • u

    user

    04/27/2021, 6:43 PM
    cool, cool.
  • u

    user

    04/27/2021, 6:43 PM
    adding an additional comment about that might be helpful.
  • u

    user

    04/27/2021, 6:43 PM
    thanks for clarifying! πŸ™‚
  • r

    rp

    04/27/2021, 6:44 PM
    Yea. We will write it in the docs for this πŸ™‚
  • z

    ZeferiniX

    04/27/2021, 11:50 PM
    Been wondering, what are the issues if we do not supply the
    apiDomain
    and/or
    websiteDomain
    on the
    appInfo
    ? And what is it being used for? https://supertokens.io/docs/nodejs/init
  • z

    ZeferiniX

    04/28/2021, 1:01 AM
    are there more details somewhere about the
    session_info
    table? just wondering if the session handle row for that user's session should be removed if the user signs out
  • z

    ZeferiniX

    04/28/2021, 1:02 AM
    or is this used for history purposes that's why it remains here?
  • r

    rp

    04/28/2021, 4:21 AM
    > what are the issues if we do not supply the apiDomain and/or websiteDomain on the appInfo? And what is it being used for? On the frontend, the
    apiDomain
    is used to query your APIs. On the backend, the
    websiteDomain
    is used to generate password reset / email verification links. The
    websiteDomain
    is also used on the frontend fro routing purposes in case you have a dedicated sub domain for auth like
    auth.example.com
    . We plan on writing a page highlighting the significance of all the items in the
    appInfo
    object since it's quite important.
  • r

    rp

    04/28/2021, 4:23 AM
    > are there more details somewhere about the session_info table? The schema of this can be found in Quick Setup > Database section. > just wondering if the session handle row for that user's session should be removed if the user signs out Yes. It should be. The
    revokeSession
    function does exactly that.
  • g

    gusfune

    04/28/2021, 2:55 PM
    Are there any known issues on
    { SignOut }
    in NextJS? We seem to have the promise always pending and users are stuck forever with their session :/
  • g

    gusfune

    04/28/2021, 2:55 PM
    Forever is way too much, but until it expires.
  • r

    rp

    04/28/2021, 2:56 PM
    There are no known issues as such. How are you using signout?
  • g

    gusfune

    04/28/2021, 2:57 PM
    import { signOut } from "supertokens-auth-react/recipe/thirdpartyemailpassword"
    
    <button
      onClick={async () => {
        await signOut()
        mutate() //SWR stuff for
        toggle() //closes the menu
        router.push("/") //redirects
      }}
    >Logout</button>
  • r

    rp

    04/28/2021, 2:57 PM
    Seems right. What's the network tab look like?
  • r

    rp

    04/28/2021, 2:58 PM
    What's the response of the signOut API call?
  • g

    gusfune

    04/28/2021, 2:58 PM
    Hm, it's stuck loading
    http://localhost:3000/api/auth/signout
  • g

    gusfune

    04/28/2021, 2:59 PM
    We are using
    [[...path]].js
    implementation without any customization.
  • g

    gusfune

    04/28/2021, 2:59 PM
    And I get in my terminal:
    [next] API resolved without sending a response for /api/auth/signout, this may result in stalled requests.
  • r

    rp

    04/28/2021, 3:00 PM
    You may want to double check your file: https://supertokens.io/docs/thirdpartyemailpassword/nextjs/setting-up-backend
  • r

    rp

    04/28/2021, 3:01 PM
    We had added:
    if (!res.writableEnded) {
        res.status(404).send('Not found')
      }
    At the ned.
  • r

    rp

    04/28/2021, 3:01 PM
    end*
  • r

    rp

    04/28/2021, 3:01 PM
    but this would mean that you will get a 404 back. Which means that the sign out API is not being found.. Can I see your backend and frontend config please?
Powered by Linen
Title
r

rp

04/28/2021, 3:01 PM
but this would mean that you will get a 404 back. Which means that the sign out API is not being found.. Can I see your backend and frontend config please?
View count: 1