mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
25 lines
935 B
TypeScript
25 lines
935 B
TypeScript
/**
|
|
* Copyright (c) OpenLens Authors. All rights reserved.
|
|
* Licensed under MIT License. See LICENSE in root directory for more information.
|
|
*/
|
|
import { getInjectable } from "@ogre-tools/injectable";
|
|
import { beforeFrameStartsFirstInjectionToken } from "../../../renderer/before-frame-starts/tokens";
|
|
import authHeaderStateInjectable from "../common/header-state.injectable";
|
|
import requestAuthHeaderValueInjectable from "./request-header.injectable";
|
|
|
|
const initAuthHeaderStateInjectable = getInjectable({
|
|
id: "init-auth-header-state",
|
|
instantiate: (di) => ({
|
|
id: "init-auth-header-state",
|
|
run: async () => {
|
|
const state = di.inject(authHeaderStateInjectable);
|
|
const requestAuthHeaderValue = di.inject(requestAuthHeaderValueInjectable);
|
|
|
|
state.set(await requestAuthHeaderValue());
|
|
},
|
|
}),
|
|
injectionToken: beforeFrameStartsFirstInjectionToken,
|
|
});
|
|
|
|
export default initAuthHeaderStateInjectable;
|