Skip to content

Commit

Permalink
Remove user from embeds
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed May 6, 2015
1 parent 2bd68fb commit 0a62151
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions lib/handlers/bin.js
Expand Up @@ -1013,8 +1013,13 @@ module.exports = Observable.extend({
}


var url = helpers.urlForBin(bin),
user = req.session.user || {};
var url = helpers.urlForBin(bin);
var user = req.session.user || {};

if (req.embed) {
// prevent it showing up in embedded views (in case someone nabs it)
delete jsbin.user;
}

var done = function () {
// Sort out the tip
Expand Down
4 changes: 2 additions & 2 deletions views/index.html
Expand Up @@ -670,11 +670,11 @@ <h2>JS Bin URLs</h2>
<script src="{{makeURL custom_js static}}{{cacheBust}}"></script>
{{/if}}
{{#feature request "intercom"}}
{{#if user.name}}
{{#unless embed}}{{#if user.name}}
<script>
window.intercomSettings = {name: "{{user.name}}", email: "{{user.email}}", created_at: {{moment user.created "X"}}, pro: {{#if user.pro}}true{{else}}false{{/if}}, bins: {{bincount}}, app_id: "{{settings.[features intercom]}}"};
(function(){var w=window;var ic=w.Intercom;if(typeof ic==="function"){ic('reattach_activator');ic('update',intercomSettings);}else{var d=document;var i=function(){i.c(arguments)};i.q=[];i.c=function(args){i.q.push(args)};w.Intercom=i;function l(){var s=d.createElement('script');s.type='text/javascript';s.async=true;s.src='https://widget.intercom.io/widget/k8fltmtp';var x=d.getElementsByTagName('script')[0];x.parentNode.insertBefore(s,x);}if(w.attachEvent){w.attachEvent('onload',l);}else{w.addEventListener('load',l,false);}}})()</script>
{{/if}}
{{/if}}{{/unless}}
{{/feature}}
</body>
</html>
Expand Down

0 comments on commit 0a62151

Please sign in to comment.