PricingBlog

My endpoints are returning 401 on published site but working in staging site, no changes with either

  • lessofchristian-1487137681141010442

    Christian Beatty

    3 hours ago

    No clue why this is happening. Checked the Xano request history, shows 200 successful for requests made in the staging site and 401 for request made on published site, even then I had published and made no changes between the two.

    I've published and made edits and published again anything that I could think of, adding logs, inspecting. I have no clue how or why this is happening.
    1
  • Only happening when authorization is required.
  • andreasmoller-1487153305691099147

    Andreas Møller

    2 hours ago

    Is the Xano endpoint receiving an auth cookie?
  • lessofchristian-1487155096281420027

    Christian Beatty

    2 hours ago

    I'm unsure, the Authorization Header shows " REMOVED " for both the requests that work and don't work. @Andreas Møller
  • andreasmoller-1487155322526240768

    Andreas Møller

    2 hours ago

    Is there a message? With the 401?
  • lessofchristian-1487157790760898631

    Christian Beatty

    2 hours ago

    {"code":"ERROR_CODE_UNAUTHORIZED","message":"Invalid token."}
  • lessofchristian-1487158265325424662

    Christian Beatty

    2 hours ago

    But I've done some console logging and the auth/login request is receiving and setting the right payload to the https cookie. I'm don't know how it's working in the staging site and not in the published one.
  • andreasmoller-1487158532037021987

    Andreas Møller

    1hour ago

    is this a ssr api?
  • lessofchristian-1487159255768240239

    Christian Beatty

    1hour ago

    I do have SSR enabled.
  • andreasmoller-1487159347862831184

    Andreas Møller

    1hour ago

    Ok, that does make it little harder to debug :/
  • lessofchristian-1487159475449368647

    Christian Beatty

    1hour ago

    Ok, I can disable it!
  • andreasmoller-1487159554251948052

    Andreas Møller

    1hour ago

    You are sure you are logged in and you have a valid auth token etc?
  • lessofchristian-1487160001322815600

    Christian Beatty

    1hour ago

    Yes, I log in on the login screen, it gets the credentials and on success of setting the access_token with Set httponly cookie it redirects to the dashboard. Then the dashboard, on a failed auth/me with that same cookie as the header auth fails and redirects me back to the login page. So it jumps from login to dashboard and then back to login.
  • Tod-1487160002841018522

    Tod

    1hour ago

    Great job @Christian Beatty! Your contribution to the Nordcraft Community just made you advance to Community Level 5! 🌲
  • lessofchristian-1487165384338575482

    Christian Beatty

    1hour ago

    Looks like it's working now after disabling ssr @Andreas Møller
  • andreasmoller-1487165624130994237

    Andreas Møller

    1hour ago

    Ok that is strange.
  • lessofchristian-1487165873990012948

    Christian Beatty

    1hour ago

    🤷‍♂️
  • andreasmoller-1487166642906464448

    Andreas Møller

    1hour ago

    I’ll have someone from the team reach out so we can try to debug.

    Most endpoints in NC is ssr so it looks like a very specific issue