Hello. I am trying to implement the user dashboard...
# support-questions
e
Hello. I am trying to implement the user dashboard but I am getting a blank white page. It looks like the html and scrips are all being downloaded and there are no errors in the console. Not quite sure where to go from here. I am using aws lambda for hosting along with a reverse proxy so could this be caused by a mismatch in settings?
r
Hey @EyesForDays Can I see the network tab, and browser console please?
e
@rp The browser console is empty but here is the network requests
r
@nkshah2 can help here.
n
Hey can you share a screenshot of the network tab instead?
Also share the config you use when calling SuperTokens init on the backend
r
@nkshah2 the .har file shows u the network request.
Drag and drop the .har file into chrome inspect element
e
Here is my config
Copy code
json
{
    framework: "awsLambda",
    supertokens: {
      connectionURI: "***",
      apiKey: "***",
    },
    appInfo: {
      appName: "checkayou.com",
      apiDomain: "https://checkayou.com",
      websiteDomain: "https://checkayou.com",
      apiBasePath: "/auth",
      apiGatewayPath: "/prod",
    },
    recipeList: [
      Passwordless.init({
        flowType: "MAGIC_LINK",
        contactMethod: "EMAIL",
      }),
      Session.init(),
      Dashboard.init({
        apiKey: "***",
      }),
    ],
    isInServerlessEnv: true,
  }
n
Right since both your website and api domain are the same you should use something similar to /api/auth for the api base path
And then visit the dashboard using /api/auth/dashboard
e
I use cloudflare workers as a reverse proxy that then calls the aws setup. So auth and other things work currently
Just to keep things nice and complicated. Is it possible that the mismatch in routes could be causing it?
I would prefer to run everything in cloudflare workers with the rest of my api, but workers don't 100% support the dependencies of supertokens-node 😦
r
Can you please open an issue about this on our GitHub describing the setup. @nkshah2 can help out in the coming week
e
Can do. Thanks for looking
n
Hey @EyesForDays when you end up on the blank screen whats the full URL in the browser it ends up on?
e
n
What result do you get when you visit http://localhost:3000/api/auth/dashboard/api/users/count in the browser?
e
I get a 401 Unauthorised access response. Looks like it is is from aws...
> {"message":"Unauthorised access"}
n
Yeah that is correct, this might be easier to debug on call if youre ok with that
e
That works for me
n
Does right now work? I can send you a link
e
yep!
n
Copy code
override: {
                apis: (original) => {
                    return {
                        ...original,
                        dashboardGET: async (input) => {
                            if (original.dashboardGET === undefined) {
                                return "";
                            }

                            let htmlString = await original.dashboardGET(input);
                            htmlString = htmlString.replace('window.dashboardAppPath = "/prod/auth/dashboard"', '');

                            return htmlString;
                        },
                    };
                }
            },
Copy code
htmlString = htmlString.replace('window.dashboardAppPath = "/prod/auth/dashboard"', 'window.dashboardAppPath = "/api/auth/dashboard"');
Copy code
functions: (original) => {
                    return {
                        ...original,
                        shouldAllowAccess: async (input) => {
                            console.log(input.req.getHeaderValue("authorization"))
                            return original.shouldAllowAccess(input);
                        },
                    };
                },
2 Views