Error when saving custom Universal Login page

When attempting to update the custom code for our Universal Login login page, I see an error:

In the developer console, the ajax request response code is 500.
It is a PATCH to https://manage.auth0.com/api/clients/redacted_id

If I paste in the old version of the file there is no error, so there is something about the new page that is causing the problem.

Also - I can load the page in my browser; there are no errors in the console, so I’m sure there are no functional bugs, broken tags, etc.

What causes errors like this?

Thanks!

Hi @ben.gladwell,

Welcome to the Auth0 Community!

Are you seeing any errors in the Auth0 Logs? There may be a log of the request with more info.

Here are a few ideas to generally troubleshoot errors in the dashboard:

  • Log out and back in to clear the session
  • Try from a new browser session (incognito/private browsing window)

I was unable to reproduce the error with some basic tests. If none of the above helps, can you please provide some detailed steps to reproduce the issue so I may troubleshoot the issue. If there is sensitive information you can send the steps in a DM.

Hi @dan.woda ,

Thanks for responding.

I actually just figured out the issue a few minutes ago. I had a large, inline base64 image that seemed to be causing the error.

I know that the /api/clients/:id endpoint returns a 413 when the file is too big. I was not getting that; just a simple 500. Is there a reason why that large, inline image would cause the 500?

@ben.gladwell,

I’m not sure why you would see the different error code. Can you host the image externally and link to it?

No, unfortunately I can’t do that. The content can’t be released publicly yet.

I don’t have a clear understanding of the use case.

Can you please elaborate on what you are trying to host on the UL page? You can also DM me if you want to keep it private.

Hi Dan -

Thanks again for trying to help.

We are using webpack to build our UL page. So, we have a number of base64-encoded images in the CSS. Everything is inlined on login.html.

I tried uploading our login.html and got a 413 error - Request entity too large. I realized that the file had ballooned in size because I had inline sourcemaps. I removed those and dramatically reduced the file size, but now I was getting 500 errors. After spending lots of time trying to figure this out, I finally tried removing a large, inline background image. That solved it. So, when I removed the large, inline, base64-encoded image, the file was able to be uploaded.

I replaced the background image with another one (also inline), but much smaller in size. This was fine. I was able to upload.

Later, I included the xregexp npm package. It includes lots of crazy unicode regexes. I started getting the 500 error again and had to remove it.

So - it seems like there is certain content that the server will reject or fail on. I’m not sure if it is related to size or the type of content or something else. Do you know anything about this?

Unfortunately, I don’t, and I can’t find any related support tickets. It’s odd that you are seeing that error instead of the 413 if the size is the root cause of the error. How big is the file? And have you tried setting it directly via the management API (this endpoint Auth0 Management API v2)?

It seems that when the page exceeds 1MB, we get a 500 error (not a 413).

Your link takes me to the “Update a client” endpoint - /api/v2/clients/{id}. I don’t see an attribute in the body params that seems to correspond to classic universal login page templates.

I do see the /api/v2/branding/templates/universal-login endpoint. But it says that is for the new universal login experience. We are using classic.

You can use the custom_login_page field to add the HTML of your custom login page per client. It may have the same hard limit, and it seems like that is causing the error according to everything you are reporting, but it would be worth trying.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.