fleet/frontend/__mocks__/userMock.ts
Gabriel Hernandez 084ebe6e16 update auth token storage (#40504)
**Related issue:** Resolves #14401

this updates the mechanism of storing the auth token for a user that is
used for making requests and validating a user session. We change the
storage from local storage to a cookie. This allow a bit more security
and prepares for a future change where we will allow the browser to
handle setting and passing the auth token in the request.

- [x] Changes file added for user-visible changes in `changes/`,
`orbit/changes/` or `ee/fleetd-chrome/changes`.
- [x] QA'd all new/changed functionality manually
2026-02-27 12:36:42 -06:00

23 lines
540 B
TypeScript

import { IUser } from "interfaces/user";
const DEFAULT_USER_MOCK: IUser = {
created_at: "2022-01-01T12:00:00Z",
updated_at: "2022-01-02T12:00:00Z",
id: 1,
name: "Test User",
email: "testUser@test.com",
role: "admin",
force_password_reset: false,
gravatar_url: "http://test.com",
sso_enabled: false,
global_role: "admin",
api_only: false,
teams: [],
fleets: [],
};
const createMockUser = (overrides?: Partial<IUser>): IUser => {
return { ...DEFAULT_USER_MOCK, ...overrides };
};
export default createMockUser;