mirror of
https://github.com/fleetdm/fleet
synced 2026-04-21 21:47:20 +00:00
**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
23 lines
540 B
TypeScript
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;
|