Checkpoint: Authentication

This commit is contained in:
aditya.chandel
2025-02-15 21:43:06 -07:00
parent e1685b2bf8
commit d3627a2d3f
25 changed files with 669 additions and 60 deletions
@@ -0,0 +1,16 @@
import {HttpInterceptorFn} from '@angular/common/http';
export const AuthInterceptorService: HttpInterceptorFn = (req, next) => {
const token = localStorage.getItem('token');
if (token) {
const clonedReq = req.clone({
setHeaders: {
Authorization: `Bearer ${token}`
}
});
return next(clonedReq);
}
return next(req);
};