Skip to content

Instantly share code, notes, and snippets.

@leonardorame
leonardorame / ngAdmin Login
Created February 9, 2015 18:37
ng-admin login
/*
Small ng-admin config showing how to inject a Login controller when
a 401 error is returned by the server.
*/
(function () {
"use strict";
var app = angular.module('myApp', [
@endel
endel / authentication.js
Last active March 24, 2016 08:55
ng-admin authentication with hook https://github.com/doubleleft/hook
var app = angular.module('admin', ['ng-admin']),
hook = new Hook.Client({...});
var headerNav, pageWrapper, restangular;
if (hook.auth.currentUser && hook.auth.currentUser.role != 'admin') {
hook.auth.logout();
}
function hideMenu() {