mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 21:00:31 +00:00
feat: register pages routes guards.
feat: retrieve all organizations details to authenticated user. feat: redux organization reducers and actions.
This commit is contained in:
@@ -5,6 +5,7 @@ const initialState = {
|
||||
token: '',
|
||||
organization: '',
|
||||
user: '',
|
||||
tenant: {},
|
||||
locale: '',
|
||||
errors: [],
|
||||
};
|
||||
@@ -15,6 +16,7 @@ export default createReducer(initialState, {
|
||||
state.token = token;
|
||||
state.user = user;
|
||||
state.organization = tenant.organization_id;
|
||||
state.tenant = tenant;
|
||||
},
|
||||
|
||||
[t.LOGIN_FAILURE]: (state, action) => {
|
||||
@@ -36,3 +38,9 @@ export const isAuthenticated = (state) => !!state.authentication.token;
|
||||
export const hasErrorType = (state, errorType) => {
|
||||
return state.authentication.errors.find((e) => e.type === errorType);
|
||||
};
|
||||
|
||||
export const isTenantSeeded = (state) => !!state.tenant.seeded_at;
|
||||
export const isTenantBuilt = (state) => !!state.tenant.initialized_at;
|
||||
|
||||
export const isTenantHasSubscription = () => false;
|
||||
export const isTenantSubscriptionExpired = () => false;
|
||||
Reference in New Issue
Block a user