remove project router, make everything from root

This commit is contained in:
Proddy
2023-02-28 18:48:00 +01:00
parent c8ea1d0c8a
commit 9e3c4134e1
8 changed files with 29 additions and 79 deletions

View File

@@ -6,13 +6,10 @@ import { Path } from 'react-router-dom';
import { Me, SignInRequest, SignInResponse } from 'types';
import { ACCESS_TOKEN, AXIOS } from './endpoints';
import { PROJECT_PATH } from './env';
export const SIGN_IN_PATHNAME = 'loginPathname';
export const SIGN_IN_SEARCH = 'loginSearch';
export const getDefaultRoute = `/${PROJECT_PATH}`;
export function verifyAuthorization(): AxiosPromise<void> {
return AXIOS.get('/verifyAuthorization');
}
@@ -21,9 +18,6 @@ export function signIn(request: SignInRequest): AxiosPromise<SignInResponse> {
return AXIOS.post('/signIn', request);
}
/**
* Fallback to sessionStorage if localStorage is absent. WebView may not have local storage enabled.
*/
export function getStorage() {
return localStorage || sessionStorage;
}
@@ -45,7 +39,7 @@ export function fetchLoginRedirect(): Partial<Path> {
const signInSearch = getStorage().getItem(SIGN_IN_SEARCH);
clearLoginRedirect();
return {
pathname: signInPathname || `/${PROJECT_PATH}`,
pathname: signInPathname || `/dashboard`,
search: (signInPathname && signInSearch) || undefined
};
}