Fix writing token to API client
This commit is contained in:
parent
11e417bb07
commit
ad2cb7e450
1 changed files with 8 additions and 5 deletions
|
@ -3,6 +3,8 @@ import UserData from '@core/auth/UserData';
|
|||
import { OidcSecurityService } from 'angular-auth-oidc-client';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { OpenAPI } from '../ems';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
|
@ -18,6 +20,7 @@ export class AuthService {
|
|||
} : undefined);
|
||||
});
|
||||
});
|
||||
this.oidcSecurityService.getAccessToken().subscribe(token => OpenAPI.TOKEN = token);
|
||||
|
||||
}
|
||||
|
||||
|
@ -26,7 +29,7 @@ export class AuthService {
|
|||
}
|
||||
|
||||
logout() {
|
||||
this.oidcSecurityService.logoff();
|
||||
this.oidcSecurityService.logoff().subscribe(() => { });
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue