Commit 9cc07e50 authored by Arko Dey Bhowmick's avatar Arko Dey Bhowmick

feat: add injectToken for formgroup in jwt service

parent 882ac55f
......@@ -21,4 +21,14 @@ export class JWTService {
'Content-Type': 'application/json',
});
}
public injectTokenForFormGroupPost(token: string): HttpHeaders {
let authorizationToken: string = localStorage.getItem('Bearer') || '';
// TODO: check if token exist in Local storage and handle accordingly
return new HttpHeaders({
Authorization: `Bearer ${authorizationToken}`,
});
}
}
......@@ -197,7 +197,7 @@ export class TransmissionService {
this._http
.post<RaintreeResponse>(url, payload, {
headers: requiresAuthentication
? this._jwt.injectToken(url)
? this._jwt.injectTokenForFormGroupPost(url)
: undefined,
})
.pipe(catchError(this._httpErrorHandler.intercept))
......
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