Skip to content

Bug in SuperTokens Node SDK with apiBasePath in supertokens.init #959

Open
@GSJ06

Description

@GSJ06

Description

I encountered an issue with the SuperTokens Node SDK when setting up a custom apiBasePath in supertokens.init. When configuring apiBasePath to include /Dashboard, the User Management Dashboard's API endpoints fail to function if the paths contain a tenant name. Below are the configuration details and issue specifics.

Configuration Used

supertokens.init({
    appName: "Dashboard",
    apiDomain: "http://localhost:5000",
    websiteDomain: "http://localhost:3000",
    apiBasePath: "/Dashboard/auth",
    websiteBasePath: "/Dashboard/auth"
});

Setup Details

  • Frontend URL: http://localhost:3000/Dashboard
  • Expected User Management Dashboard URL: http://localhost:5000/Dashboard/auth/dashboard

Issue

After setting apiBasePath to /Dashboard/auth, the SuperTokens User Management Dashboard APIs, specifically those containing a tenant name in their paths, fail to work. The expected Dashboard URL (e.g., http://localhost:5000/Dashboard/auth/dashboard) does not function correctly under this setup.

Steps to Reproduce

  1. Set up supertokens.init as shown in the configuration above.
  2. Attempt to access the User Management Dashboard at the specified URL.
  3. Observe that any API call involving tenant-specific paths fails to respond correctly.

Expected Behavior

The User Management Dashboard APIs should work seamlessly regardless of custom apiBasePath configurations, including cases where /Dashboard is used in the path.

Actual Behavior

APIs with tenant paths in the User Management Dashboard do not function when apiBasePath is set with /Dashboard.

Supertokens Dashboard issue 2
Supertokens Dashboard issue

Thank you for looking into this issue. Let me know if you need further details or logs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions