<script type="text/javascript">
  window.DEFAULT_SETTINGS = {
    apiUrl: '<%= application_base_url %>',
    csrfToken: '<%= form_authenticity_token %>',
    jwt: '<%= jwt_token %>'
  };
</script>

<%-
  settings = {
    apiUrl: application_base_url,
    csrfToken: form_authenticity_token
  }
  if signed_in?
    settings[:userId] = current_user.id
    settings[:email] = current_user.email
    settings[:displayName] = current_user.display_name
    settings[:jwt] = jwt_token
  end
%>
<script type="text/javascript">
  window.DEFAULT_SETTINGS = <%= settings.to_json.html_safe %>;
</script>

Use json for default settings.
Use json for default settings.
