added refresh token when check on authorization cookie is successful

This commit is contained in:
Giuseppe Digilio
2020-01-17 11:09:41 +01:00
parent 49e59c44e1
commit afe70bc546
4 changed files with 14 additions and 13 deletions

View File

@@ -208,7 +208,9 @@ export class AuthService {
const options: HttpOptions = Object.create({});
let headers = new HttpHeaders();
headers = headers.append('Accept', 'application/json');
headers = headers.append('Authorization', `Bearer ${token.accessToken}`);
if (token && token.accessToken) {
headers = headers.append('Authorization', `Bearer ${token.accessToken}`);
}
options.headers = headers;
return this.authRequestService.postToEndpoint('login', {}, options).pipe(
map((status: AuthStatus) => {