https://supertokens.com/ logo
#general
Title
# general
m

marshmalon

02/21/2022, 6:21 PM
I'm having an error where I authenticated using supertokens on my auth.example.com service. Then my service.example.com is trying to call an api route | service.example.com/route, but I keep getting a 401 error
r

rp

02/21/2022, 6:22 PM
I’m gonna need some more info. Like what are the request headers?
m

marshmalon

02/21/2022, 6:24 PM
Here's a picture of the request headers
I see I have the session token working
r

rp

02/21/2022, 6:24 PM
Partially. The sAccessToken is missing. Which is the main token
What’s your backend and frontend config?
And what’s the domain this request is querying?
m

marshmalon

02/21/2022, 6:32 PM
Copy code
SuperTokens.init({
    appInfo: {
        appName: "Diva Labs", // TODO: Your app name
        apiBasePath: "api/v3/auth",
        websiteBasePath: "auth",
        apiDomain: getApiDomain(), // TODO: Change to your app's API domain
        websiteDomain: getWebsiteDomain(), // TODO: Change to your app's website domain
    },
    recipeList: [
        EmailPassword.init({
            emailVerificationFeature: {
                mode: "REQUIRED",
            },
        }),
        Session.init({
            sessionScope: ".diva.so",
            cookieDomain: ".diva.so",
        }),
        // Session.init()
    ],
});
I just added the cookieDomain and I think it's working now
This is the front-end ^^
Copy code
supertokens.init({
  framework: "express",
  supertokens: {
      connectionURI: connectionURI,
      apiKey: apiKey,
  },
  appInfo: {
      appName: "Diva Auth",
      apiBasePath: "/api/v3/auth",
      websiteBasePath: "auth",
      apiDomain,
      websiteDomain,

  },
    recipeList: [EmailPassword.init(), Session.init({cookieDomain: ".diva.so"})],
});
Backend ^^
r

rp

02/21/2022, 6:32 PM
Cool!
If you run into issues, please feel free to reach out 🙂
Are you and @User on the same project?
If yes, and you look at the other thread from the general channel, you will see our conversation there
a

aquajet

02/21/2022, 6:37 PM
lol yeah
r

rp

02/21/2022, 6:37 PM
Haha okay
So you have a node and a python backend. Cool!
a

aquajet

02/21/2022, 6:40 PM
yeah we just need go to hit the trifecta
r

rp

02/21/2022, 6:41 PM
Hehe!
3 Views