Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MarkusStoffer opened this issue Jun 13, 2024 · 1 comment

Comments

@MarkusStoffer
Copy link

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:

<script>window.APP_CONFIG = JSON.parse('{"translations":{"en":{"share-hashtag":"","contact-email":"","company-name":"","app-tagline":"","app-name":"","app-description":" ."}},"theme":{"nametag-text-color":"#0008ff"},"images":{"logo":"","home_background":"","company_logo":"","app_icon":""},"features":{"max_room_size":50,"hide_powered_by":true,"default_room_size":24},"auth":{"login_subject":"","login_body":" \n."}}')</script>

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants