Skip to content

Instantly share code, notes, and snippets.

View hidegh's full-sized avatar

balazs HIDEGHETY hidegh

View GitHub Profile
@hidegh
hidegh / auth.service.ts
Created October 25, 2021 12:48
authService - WorkFlowWise (wfw-ngx-adal - with acquireToken patch) and custom JWT.ts
import { Injectable } from "@angular/core";
import { Router } from "@angular/router";
import { JwtHelperService } from '@auth0/angular-jwt';
import { BehaviorSubject, from, Observable, of } from "rxjs";
import { distinctUntilChanged, take, tap } from "rxjs/operators";
import { RoleConsts } from "src/app/_core/security/roles-consts";
import { CurrentUserService } from "src/app/_services/current-user/current-user.service";
import { IUserProfile } from "src/app/_services/current-user/i.user.profile";
import { environment } from 'src/environments/environment';
import { AdalService } from "wfw-ngx-adal/dist/core";
/// <summary>
/// Depends on domain events...
/// Reason: wanted to de-couple it from the next job and so I do have DI objects accessible...
///
/// NOTE:
/// This is by default a PERMANENT failure notification filter, since the filter Order is so high, it get's surely executed after the AutomaticRetry filter.
/// Also if AutomaticRetry filter does delete the job on permanent fail, the PERMANENT failure notification won't occure.
///
/// If the HangfirePermanentFailureNotificationEvent.Order is less than the AutomaticRetry.Order, we will get a notification on each failure, not just the last one!
/// </summary>