Hubs-Foundation / hubs-cloud

Resources for self hosted Hubs Cloud instances
Mozilla Public License 2.0
149 stars 88 forks source link

Line break in admin setting's email body causes loading issues on main page #347

Open Markus-4DRL opened 3 weeks ago

Markus-4DRL commented 3 weeks ago

When entering a text for the Magic Link Email Body (in admin settings -> setup -> app settings -> auth), adding any line breaks will cause a console error that prevents loading any app settings on the landing page.

The error is in this code:

The line break becomes \n, which seems to disrupts the json parse, I assume because it's not escaped. In Chrome, the error in the console is:

VM152:1 Uncaught SyntaxError: Bad control character in string literal in JSON at position 1029 (line 1 column 1030) at JSON.parse () at (index):35:34

A workaround that I am using now is simply not having any line breaks in the text.

TaisukeMorimoto commented 2 weeks ago

I also had a problem due to the same cause when I used hubs cloud, and it took a long time to debug it..