Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// baseURL: '$KONG_NGROK_PROXY_URL',
// timeout: 1000
// })
// .get('/api/v0/id?jwt=' + accessToken);
// console.log(data);
}}
>
Test IPFS
);
}
}
export default withAuth(Settings);
const mapStateToProps = state => {
return {
user: state.user
};
};
const mapDispatchToProps = dispatch => {
return {
// go: (somePath) => dispatch(push(somePath)),
setWeb3Account: async web3Account => {
dispatch(actionsCreators.setWeb3Account(web3Account));
}
};
};
export default withStyles(styles)(
connect(mapStateToProps, mapDispatchToProps)(withAuth(Demo))
);
import { createStore, applyMiddleware, compose } from 'redux';
import { Provider } from 'react-redux';
import logger from 'redux-logger';
import thunk from 'redux-thunk';
import { createBrowserHistory } from 'history';
const history = createBrowserHistory();
/* eslint-disable no-underscore-dangle */
const composeEnhancers = window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ || compose;
const store = createStore(
reducers, composeEnhancers(applyMiddleware(logger, thunk))
);
/* eslint-enable */
const auth = new Auth({
history,
issuer: config.issuer,
client_id: config.client_id,
redirect_uri: config.redirect_uri,
onAuthRequired: ({history}) => history.push('/node-okta-react-redux/login')
});
ReactDOM.render(
,
document.getElementById('root')
variant="raised"
color="secondary"
onClick={this.handleSubmit}
disabled={name.trim().length === 0 || description.trim().length === 0}
>
Create
);
}
}
export default withStyles(styles)(
connect(null, null)(withAuth(withGroups(GroupCard)))
);
import React, { Component } from 'react';
import { withAuth } from '@okta/okta-react';
import Button from 'material-ui/Button';
export default withAuth(
class OktaAuthButton extends Component {
constructor(props) {
super(props);
this.state = { authenticated: null };
this.checkAuthentication = this.checkAuthentication.bind(this);
this.login = this.login.bind(this);
this.logout = this.logout.bind(this);
}
async checkAuthentication() {
const authenticated = await this.props.auth.isAuthenticated();
if (authenticated !== this.state.authenticated) {
this.setState({ authenticated });
}
}
);
}
}
export default withAuth(PrimaryMenu);
const mapDispatchToProps = dispatch => {
return {
setUserProfile: async (auth, profile) => {
dispatch(actions.setUserProfile(auth, profile));
},
getUser: async auth => {
dispatch(actions.getUser(auth));
}
};
};
export default withStyles(styles)(
connect(null, mapDispatchToProps)(
withAuth(ProfilePage)
)
);
};
const mapStateToProps = state => {
return {
error: state.user.error
};
};
const mapDispatchToProps = dispatch => {
return {
logoutUser: () => dispatch(actionCreators.logout())
};
};
export default withStyles(styles, { withTheme: true })(
connect(mapStateToProps, mapDispatchToProps)(withAuth(MiniDrawer))
);
import React, { Component } from 'react';
import { withAuth } from '@okta/okta-react';
import Button from 'material-ui/Button';
export default withAuth(
class OktaAuthButton extends Component {
constructor(props) {
super(props);
this.state = { authenticated: null };
this.checkAuthentication = this.checkAuthentication.bind(this);
this.checkAuthentication();
this.login = this.login.bind(this);
this.logout = this.logout.bind(this);
}
async checkAuthentication() {
const authenticated = await this.props.auth.isAuthenticated();
if (authenticated !== this.state.authenticated) {
this.setState({ authenticated });
}
}
history.push('/messages')}
>
);
}
}
export default withAuth(UserMenu);