forked from angular-app/angular-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
045fcfd
commit 21c38aa
Showing
24 changed files
with
82 additions
and
80 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
// Based loosely around work by Witold Szczerba - https://github.com/witoldsz/angular-http-auth | ||
angular.module('authentication', ['authentication.service', 'authentication.interceptor', 'authentication.login']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
client/src/common/security/currentUser.js → .../src/common/authentication/currentUser.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
angular.module('authentication.login', ['authentication.login.form', 'authentication.login.toolbar']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
angular.module('authentication.login.toolbar', []) | ||
|
||
// The loginToolbar directive is a reusable widget that can show login or logout buttons | ||
// and information the current authenticated user | ||
.directive('loginToolbar', ['currentUser', 'authentication', function(currentUser, authentication) { | ||
var directive = { | ||
templateUrl: 'authentication/login/toolbar.tpl.html', | ||
restrict: 'E', | ||
replace: true, | ||
scope: true, | ||
link: function($scope, $element, $attrs, $controller) { | ||
$scope.userInfo = currentUser.info; | ||
$scope.isAuthenticated = currentUser.isAuthenticated; | ||
$scope.logout = function() { authentication.logout(); }; | ||
$scope.login = function() { authentication.showLogin(); }; | ||
} | ||
}; | ||
return directive; | ||
}]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<ul class="nav pull-right"> | ||
<li class="divider-vertical"></li> | ||
<li ng-show="isAuthenticated()"> | ||
<a href="#">{{userInfo().firstName}} {{userInfo().lastName}}</a> | ||
</li> | ||
<li ng-show="isAuthenticated()" class="logout"> | ||
<form class="navbar-form"> | ||
<button class="btn" ng-click="logout()">Log out</button> | ||
</form> | ||
</li> | ||
<li ng-hide="isAuthenticated()" class="login"> | ||
<form class="navbar-form"> | ||
<button class="btn" ng-click="login()">Log in</button> | ||
</form> | ||
</li> | ||
</ul> |
8 changes: 4 additions & 4 deletions
8
client/src/common/security/retryQueue.js → ...t/src/common/authentication/retryQueue.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
...unit/common/security/current-user.spec.js → ...ommon/authentication/current-user.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
.../unit/common/security/interceptor.spec.js → ...common/authentication/interceptor.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,7 @@ describe('login-toolbar', function() { | |
var userInfo = { id: '1234567890', email: '[email protected]', firstName: 'Jo', lastName: 'Bloggs'}; | ||
var scope, toolbar; | ||
|
||
beforeEach(module('security/login/toolbar.tpl.html', 'security')); | ||
beforeEach(module('authentication/login/toolbar.tpl.html', 'authentication')); | ||
|
||
beforeEach(inject(function($httpBackend, $rootScope, $compile) { | ||
$httpBackend.when('GET', '/current-user').respond(200, { user: userInfo }); | ||
|
6 changes: 3 additions & 3 deletions
6
.../unit/common/security/retry-queue.spec.js → ...common/authentication/retry-queue.spec.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters