Browse Source
* PM-2283 - Update config api service get server config call to send authed when we have an access token so that LaunchDarkly on the server can properly acquire user context. * PM-2283- Replace token service with Auth service per PR feedback * PM-2283 - Refactor config api service get authed status based on PR feedback. * PM-2283 - Fix import issues due to platform folder creation and file movespull/5582/head
2 changed files with 9 additions and 4 deletions
@ -1,12 +1,17 @@
@@ -1,12 +1,17 @@
|
||||
import { ApiService } from "../../../abstractions/api.service"; |
||||
import { ConfigApiServiceAbstraction as ConfigApiServiceAbstraction } from "../../abstractions/config/config-api.service.abstraction"; |
||||
import { AuthService } from "../../../auth/abstractions/auth.service"; |
||||
import { AuthenticationStatus } from "../../../auth/enums/authentication-status"; |
||||
import { ConfigApiServiceAbstraction } from "../../abstractions/config/config-api.service.abstraction"; |
||||
import { ServerConfigResponse } from "../../models/response/server-config.response"; |
||||
|
||||
export class ConfigApiService implements ConfigApiServiceAbstraction { |
||||
constructor(private apiService: ApiService) {} |
||||
constructor(private apiService: ApiService, private authService: AuthService) {} |
||||
|
||||
async get(): Promise<ServerConfigResponse> { |
||||
const r = await this.apiService.send("GET", "/config", null, false, true); |
||||
const authed: boolean = |
||||
(await this.authService.getAuthStatus()) !== AuthenticationStatus.LoggedOut; |
||||
|
||||
const r = await this.apiService.send("GET", "/config", null, authed, true); |
||||
return new ServerConfigResponse(r); |
||||
} |
||||
} |
||||
|
||||
Loading…
Reference in new issue