mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-10-14 19:31:30 +08:00

* chore: update auth * chore: password changes * chore: make changes in oss code * chore: login * chore: get to a running state * fix: migration inital commit * fix: signoz cloud intgtn tests * fix: minor fixes * chore: sso code fixed with org domain * fix: tests * fix: ee auth api's * fix: changes in name * fix: return user in login api * fix: address comments * fix: validate password * fix: handle get domain by email properly * fix: move authomain to usermodule * fix: use displayname instead of hname * fix: rename back endpoints * fix: update telemetry * fix: correct errors * fix: test and fix the invite endpoints * fix: delete all things related to user in store * fix: address issues * fix: ee delete invite * fix: rename func * fix: update user and update role * fix: update role * chore(api): update the api folder structure according to rest principles * fix: login and invite changes * chore(api): update the api folder structure according to rest principles * chore(login): update the frontend according to the new APIs * fix: return org name in users response * chore(login): update the frontend according to the new APIs * fix: update user role * fix: nil check * chore(login): update the frontend according to the new API * fix: getinvite and update role * fix: sso * fix: getinvite use sso ctx * fix: use correct sourceurl * fix: getsourceurl from req payload * chore(login): update the frontend according to the new API * fix: update created_at * fix: fix reset password * chore(login): fixed reset password and bulk invites * fix: sso signup and token password change * fix: don't delete last admin * fix: reset password and migration * fix: migration * chore(login): fix the unwanted throw statement and tsconfig * fix: reset password for sso users * fix: clean up invite * chore(login): delete last admin user and reset password * fix: migration * fix: update claims and store code * fix: use correct error * fix: proper nil checks * fix: make migration multitenant * fix: address comments * fix: minor fixes * fix: test * fix: rename reset password * fix: set self restration only when sso endabled * chore(auth): update the invite user API * fix: integration tests * fix: integration tests * fix: integration tests * fix: integration tests * fix: integration tests * fix: integration tests * fix: integration tests * chore(auth): update integration test * fix: telemetry --------- Co-authored-by: nityanandagohain <nityanandagohain@gmail.com>
29 lines
662 B
TypeScript
29 lines
662 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: '',
|
|
displayName: '',
|
|
createdAt: 0,
|
|
organization: '',
|
|
orgId: '',
|
|
role: 'VIEWER',
|
|
};
|
|
}
|
|
|
|
export { getUserDefaults };
|