I'm having an error where I authenticated using su...
# general
m
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
I’m gonna need some more info. Like what are the request headers?
m
Here's a picture of the request headers
I see I have the session token working
r
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
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
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
lol yeah
r
Haha okay
So you have a node and a python backend. Cool!
a
yeah we just need go to hit the trifecta
r
Hehe!
3 Views