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
Showing
6 changed files
with
97 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
|
||
|
||
describe('Login', () => { | ||
|
||
describe('Configuration', () => { | ||
|
||
let LoginController:ng.IControllerService, | ||
$scope:ng.IScope, | ||
authService:NgJwtAuth.NgJwtAuthService; | ||
|
||
beforeEach(() => { | ||
|
||
module('app'); | ||
}); | ||
|
||
beforeEach(()=> { | ||
inject(($controller, $rootScope, _ngJwtAuthService_) => { | ||
$scope = $rootScope.$new(); | ||
authService = _ngJwtAuthService_; | ||
LoginController = $controller(app.guest.login.namespace+'.controller', {$scope: $scope}); | ||
}) | ||
}); | ||
|
||
it('should be a valid controller', () => { | ||
|
||
expect(LoginController).to.be.ok; | ||
}); | ||
|
||
it('should have initialised the auth service', () => { | ||
|
||
expect((<any>authService).refreshTimerPromise).to.be.ok; | ||
|
||
}) | ||
|
||
|
||
}); | ||
|
||
}); |
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,3 @@ | ||
<h2>Success!</h2> | ||
<h3>Your build of spira has succeeded</h3> | ||
<md-icon> face </md-icon> |
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,51 @@ | ||
module app.guest.login { | ||
|
||
export const namespace = 'app.guest.login'; | ||
|
||
class LoginConfig { | ||
|
||
static $inject = ['ngJwtAuthServiceProvider']; | ||
constructor(private ngJwtAuthServiceProvider:NgJwtAuth.NgJwtAuthServiceProvider){ | ||
|
||
let config : NgJwtAuth.INgJwtAuthServiceConfig = { | ||
refreshBeforeSeconds: 60 * 10, //10 mins | ||
checkExpiryEverySeconds: 60, //1 min | ||
}; | ||
|
||
ngJwtAuthServiceProvider.configure(config); | ||
|
||
} | ||
|
||
} | ||
|
||
class LoginInit { | ||
|
||
static $inject = ['ngJwtAuthService']; | ||
constructor( | ||
private ngJwtAuthService:NgJwtAuth.NgJwtAuthService | ||
) { | ||
|
||
ngJwtAuthService.init(); //initialise the auth service (kicks off the timers etc) | ||
} | ||
|
||
} | ||
|
||
interface IScope extends ng.IScope | ||
{ | ||
} | ||
|
||
class LoginController { | ||
|
||
static $inject = ['$scope']; | ||
constructor(private $scope : IScope) { | ||
|
||
} | ||
|
||
} | ||
|
||
angular.module(namespace, []) | ||
.config(LoginConfig) | ||
.run(LoginInit) | ||
.controller(namespace+'.controller', LoginController); | ||
|
||
} |
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