Skip to content

Commit

Permalink
Updating auth service to use notification service.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Sik committed Aug 12, 2015
1 parent dc5979a commit cd34814
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/src/common/services/auth/authService.ts
Expand Up @@ -6,15 +6,15 @@ namespace common.services.auth {

public initialisedPromise:ng.IPromise<any>;

static $inject:string[] = ['ngJwtAuthService', '$q', '$location', '$timeout', '$mdDialog', '$state', '$mdToast'];
static $inject:string[] = ['ngJwtAuthService', '$q', '$location', '$timeout', '$mdDialog', '$state', 'notificationService'];

constructor(private ngJwtAuthService:NgJwtAuth.NgJwtAuthService,
private $q:ng.IQService,
private $location:ng.ILocationService,
private $timeout:ng.ITimeoutService,
private $mdDialog:ng.material.IDialogService,
private $state:ng.ui.IStateService,
private $mdToast:ng.material.IToastService
private notificationService:common.services.notification.NotificationService
) {

this.initialisedPromise = this.initialiseJwtAuthService().finally(() => {
Expand Down Expand Up @@ -111,12 +111,7 @@ namespace common.services.auth {

return this.ngJwtAuthService.exchangeToken(token)
.catch((err) => {
this.$mdToast.show(
this.$mdToast.simple()
.hideDelay(2000)
.position('top right')
.content("Sorry, you have already tried to reset your password using this link")
);
this.notificationService.toast('Sorry, you have already tried to reset your password using this link').options({position:'top right'}).pop();
});
}

Expand Down

0 comments on commit cd34814

Please sign in to comment.