Getting CORS error. Using a Django (4+) backend an...
# support-questions-legacy
a
Getting CORS error. Using a Django (4+) backend and a React (18+) frontend. Django config:
Copy code
init(
    app_info=InputAppInfo(
        app_name="TEST-APP",
        api_domain="http://localhost:8000/",
        website_domain="http://localhost:3000/",
        api_base_path="/api/auth",
        website_base_path="/auth",
    ),
    supertokens_config=SupertokensConfig(
        connection_uri=os.environ.get("AUTH_CONNECTION_URI"),
        api_key=os.environ.get("AUTH_API_KEY"),
    ),
    framework="django",
    recipe_list=[
        session.init(),
        thirdparty.init(
            sign_in_and_up_feature=thirdparty.SignInAndUpFeature(
                providers=[
                    Google(
                        client_id=os.environ.get("GOOGLE_CLIENT_ID"),
                        client_secret=os.environ.get("GOOGLE_CLIENT_SECRET"),
                    ),
                ]
            )
        ),
    ],
    mode="wsgi",  # use wsgi if you are running django server in sync mode
)

CORS_ORIGIN_WHITELIST = [
    # os.environ.get("AUTH_WEBSITE_DOMAIN")
    "http://localhost:3000/"
]

CORS_ALLOW_CREDENTIALS = True

CORS_ALLOWED_ORIGINS = [
    # os.environ.get("AUTH_WEBSITE_DOMAIN")
    "http://localhost:3000/"
]

CORS_ALLOW_HEADERS: List[str] = (
    list(default_headers) + ["Content-Type"] + get_all_cors_headers()
)
React config:
Copy code
SuperTokens.init({
  appInfo: {
    appName: "TEST-APP",
    apiDomain: "http://localhost:8000/",
    websiteDomain: "http://localhost:3000/",
    apiBasePath: "/api/auth",
    websiteBasePath: "/auth",
  },
  recipeList: [
    ThirdParty.init({
      signInAndUpFeature: {
        providers: [Google.init()],
      },
    }),
    Session.init(),
  ],
});
What am I missing here?
3 Views