Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export function fnDelonAuthConfig(): DelonAuthConfig {
return {
...new DelonAuthConfig(),
...{ login_url: '/passport/login', ignores: [/\/login/, /assets\//, /api\/(?!admin)[\w_-]+\/\S*/] } as DelonAuthConfig
};
}
export function fnDelonAuthConfig(): DelonAuthConfig {
return {
...new DelonAuthConfig(),
login_url: '/passport/login',
ignores: [
/assets\//,
/passport\//,
/api\/(?!admin)[\w_-]+\/\S*/
]
};
}
intercept(req: HttpRequest, next: HttpHandler): Observable> {
const options = { ...new DelonAuthConfig(), ...this.injector.get(DelonAuthConfig, undefined) };
req = this.addToken(req, options, null);
return next.handle(req).pipe(
mergeMap((event: any) => {
if (event instanceof HttpResponseBase) {
if (event.status === 200 && (event instanceof HttpResponse)) {
const result: AjaxResult = event.body as AjaxResult;
if (result && result.Type === AjaxResultType.UnAuth) {
return this.handle401Error(req, next, options, event);
}
}
}
return of(event);
}),
catchError((error: HttpErrorResponse) => {
if (error instanceof HttpErrorResponse && error.status === 401) {
export function fnDelonAuthConfig(): DelonAuthConfig {
return {
...new DelonAuthConfig(),
...{
login_url: '/passport/login',
executeOtherInterceptors: false
} as DelonAuthConfig
};
}
export function fnDelonAuthConfig(): DelonAuthConfig {
return {
...new DelonAuthConfig(),
login_url: '/passport/login',
ignores: [
/assets\//,
/passport\//,
/api\/(?!admin)[\w_-]+\/\S*/
]
};
}
intercept(req: HttpRequest, next: HttpHandler): Observable> {
const options = { ...new DelonAuthConfig(), ...this.injector.get(DelonAuthConfig, undefined) };
req = this.addToken(req, options, null);
return next.handle(req).pipe(
mergeMap((event: any) => {
if (event instanceof HttpResponseBase) {
if (event.status === 200 && (event instanceof HttpResponse)) {
const result: AjaxResult = event.body as AjaxResult;
if (result && result.Type === AjaxResultType.UnAuth) {
return this.handle401Error(req, next, options, event);
}
}
}
return of(event);
}),
catchError((error: HttpErrorResponse) => {
if (error instanceof HttpErrorResponse && error.status === 401) {
export function fnDelonAuthConfig(): DelonAuthConfig {
return {
...new DelonAuthConfig(),
...{ login_url: '/passport/login' } as DelonAuthConfig
};
}