updates to core web framework

This commit is contained in:
proddy
2020-11-14 12:48:21 +01:00
parent 42002e56d4
commit b19500f84b
4 changed files with 1210 additions and 1103 deletions

View File

@@ -9,7 +9,7 @@ import { AuthenticationContext, Me } from './AuthenticationContext';
import FullScreenLoading from '../components/FullScreenLoading';
import { withFeatures, WithFeaturesProps } from '../features/FeaturesContext';
export const decodeMeJWT = (accessToken: string): Me => jwtDecode(accessToken);
export const decodeMeJWT = (accessToken: string): Me => jwtDecode(accessToken) as Me;
interface AuthenticationWrapperState {
context: AuthenticationContext;
@@ -59,7 +59,7 @@ class AuthenticationWrapper extends React.Component<AuthenticationWrapperProps,
}
refresh = () => {
// proddy removed
// commented out, always need security - proddy
// if (!this.props.features.security) {
// this.setState({ initialized: true, context: { ...this.state.context, me: { admin: true, username: "admin" } } });
// return;
@@ -107,4 +107,4 @@ class AuthenticationWrapper extends React.Component<AuthenticationWrapperProps,
}
export default withFeatures(withSnackbar(AuthenticationWrapper))
export default withFeatures(withSnackbar(AuthenticationWrapper))