Commit 89253046 by Nattana Chaiyamat

แก้ login ไม่ต้องส่ง token

parent 2c4d1029
...@@ -34,7 +34,9 @@ export class HttpRequestInterceptor { ...@@ -34,7 +34,9 @@ export class HttpRequestInterceptor {
authReq = req.clone(overideReq); authReq = req.clone(overideReq);
} }
return next.handle(authReq).pipe(catchError(error => { return next.handle(authReq).pipe(catchError(error => {
if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403) && !fullUrl.includes("login")) { if (fullUrl.includes("login")) {
return next.handle(this.addTokenHeader(req, "Bearer ", fullUrl))
} else if (error instanceof HttpErrorResponse && (error.status === 401 || error.status === 403) && !fullUrl.includes("login")) {
return this.handle403Error(authReq, next, fullUrl); return this.handle403Error(authReq, next, fullUrl);
} }
return throwError(error); return throwError(error);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment