How to use @okta/okta-react - 10 common examples

To help you get started, we’ve selected a few @okta/okta-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github transmute-industries / transmute / packages / transmute-dashboard / src / Components / Settings / index.js View on Github external
//     baseURL: '$KONG_NGROK_PROXY_URL',
            //     timeout: 1000
            //   })
            //   .get('/api/v0/id?jwt=' + accessToken);

            // console.log(data);
          }}
        >
          Test IPFS
        
      
    );
  }
}

export default withAuth(Settings);
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Demo / index.js View on Github external
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))
);
github mabc224 / node-okta-react-redux / client / src / index.js View on Github external
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')
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Groups / GroupsPage / CreateGroupCard / CreateGroupCard.js View on Github external
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)))
);
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Auth / OktaAuthButton.js View on Github external
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 });
      }
    }
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Profile / ProfilePage.js View on Github external
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)
  )
);
github transmute-industries / transmute / packages / transmute-dashboard / src / components / AppBar / index.js View on Github external
};

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))
);
github transmute-industries / transmute / packages / transmute-dashboard / src / components / Auth / OktaAuthButton.js View on Github external
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 });
      }
    }

@okta/okta-react

React support for Okta

Apache-2.0
Latest version published 6 months ago

Package Health Score

79 / 100
Full package analysis

Popular @okta/okta-react functions