Following these steps allow you to show/hide a widget based on whether or not a user is signed in.
gs.isLoggedIn();
ng-if="!data.loggediin"
will show for unauthenticated users, ng-if="data.loggedin"
will show for authenticated users.<!-- Example div -->
<div ng-if="!data.loggedin" class="card" onclick="location.href='https://some-link.com';">
<p class="card-details">
Sign into portal
</p>
</div>
api.controller=function() {
/* widget controller */
var c = this;
};
(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.loggedin = gs.isLoggedIn();
})();