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 { OidcSecurityService } from 'angular-auth-oidc-client';
|
||||||
import { Observable } from 'rxjs';
|
import { Observable } from 'rxjs';
|
||||||
|
|
||||||
|
import { OpenAPI } from '../ems';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
|
@ -18,6 +20,7 @@ export class AuthService {
|
||||||
} : undefined);
|
} : undefined);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
this.oidcSecurityService.getAccessToken().subscribe(token => OpenAPI.TOKEN = token);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,7 +29,7 @@ export class AuthService {
|
||||||
}
|
}
|
||||||
|
|
||||||
logout() {
|
logout() {
|
||||||
this.oidcSecurityService.logoff();
|
this.oidcSecurityService.logoff().subscribe(() => { });
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue