<div class="tab-pane active" id="connectedDevices">
<script>
if (req.user.pebble.watch_token == String) {
<i class="fa fa-check"> Pebble </i>
} else{
<i class="fa fa-warning">No Pebble connected</i>
};
</script>
</div>
Using local strategy and Pebble kit to verify if a user has a pebble connected. All the AUTH is working, just wondering why nothing is showing up now.
You are getting an error because <
isn't allowed where you are putting it. You have a <
because you have placed some HTML in the middle of your JavaScript.
You say, in the comments, that you are using EJS, but if you were using the syntax shown on the homepage then your template would look like this:
<% if (req.user.pebble.watch_token == String) { %>
<i class="fa fa-check"> Pebble </i>
<% } else { %>
<i class="fa fa-warning">No Pebble connected</i>
<% } %>
and would be in a .ejs
template file loaded with:
var html = new EJS({url: 'example.ejs'}).render(data);
You would then have the HTML in a variable that you could use with innerHTML
on an element.