Skip to content

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

Description

@MarkusStoffer

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions