mirror of
https://github.com/SigNoz/signoz.git
synced 2025-12-20 17:07:18 +00:00
* feat: setup the app context to fetch users,licenses and feature flags * feat: added global event listeners for after_login event * feat: remove redux from app state and private route * feat: syncronize the approutes file * feat: cleanup the private routes * feat: handle login and logout * feat: cleanup the app layout file * feat: cleanup and syncronize side nav item * fix: minor small re-render issue * feat: parallel processing for sync calls for faster bootup of application * feat: some refactoring for private routes * fix: entire application too much re-rendering * fix: remove redux * feat: some more corrections * feat: fix all the files except signup * feat: add app provider to the test-utils * feat: should fix a lot of tests * chore: fix more tests * chore: fix more tests * feat: fix some tests and corrected the redux mock * feat: delete snapshot * fix: test cases * fix: pipeline actions test cases * fix: billing test cases * feat: update the signup API to accept isAnonymous and hasOptedUpdates * chore: cleanup the console logs * fix: indefinite loading on manage licenses screen * fix: better handling and route to something_went_wrong in case of qs down * fix: signup for subsequent users * chore: update test-utils * fix: jerky behaviour on entering the home page * feat: handle the retention for login context flow * fix: do not let users workaround workspace blocked screen
32 lines
708 B
TypeScript
32 lines
708 B
TypeScript
import getLocalStorageApi from 'api/browser/localstorage/get';
|
|
import { LOCALSTORAGE } from 'constants/localStorage';
|
|
import { defaultTo } from 'lodash-es';
|
|
|
|
import { IUser } from './types';
|
|
|
|
function getUserDefaults(): IUser {
|
|
const accessJwt = defaultTo(getLocalStorageApi(LOCALSTORAGE.AUTH_TOKEN), '');
|
|
const refreshJwt = defaultTo(
|
|
getLocalStorageApi(LOCALSTORAGE.REFRESH_AUTH_TOKEN),
|
|
'',
|
|
);
|
|
const userId = defaultTo(getLocalStorageApi(LOCALSTORAGE.USER_ID), '');
|
|
|
|
return {
|
|
accessJwt,
|
|
refreshJwt,
|
|
id: userId,
|
|
email: '',
|
|
name: '',
|
|
profilePictureURL: '',
|
|
createdAt: 0,
|
|
flags: {},
|
|
organization: '',
|
|
orgId: '',
|
|
role: 'VIEWER',
|
|
groupId: '',
|
|
};
|
|
}
|
|
|
|
export { getUserDefaults };
|