Implement user-specific tutorial access and enhance authentication handling

This commit is contained in:
liosha84
2025-07-06 11:00:17 +03:00
parent 140de83d0a
commit 3fdb1b4640
18 changed files with 153 additions and 25 deletions
@@ -12,15 +12,25 @@ export class AuthInterceptor implements HttpInterceptor {
constructor(private token: TokenStorageService) { }
intercept(req: HttpRequest<any>, next: HttpHandler): Observable<HttpEvent<any>> {
let authReq = req;
req = req.clone({
withCredentials: true,
});
return next.handle(req);
/*let authReq = req;
const token = this.token.getToken();
if (token != null) {
authReq = req.clone({ headers: req.headers.set(TOKEN_HEADER_KEY, 'Bearer ' + token) });
}
return next.handle(authReq);
return next.handle(authReq);*/
}
}
export const authInterceptorProviders = [
{ provide: HTTP_INTERCEPTORS, useClass: AuthInterceptor, multi: true }
];
];