How to use the @okta/okta-react.withAuth function in @okta/okta-react

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 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 });
      }
    }
github mabc224 / node-okta-react-redux / client / src / components / Header / Header.js View on Github external
<div>
                    <a href="#">React App</a>
                    <button aria-label="Toggle navigation" aria-expanded="false" aria-controls="navbarResponsive" data-target="#navbarResponsive" data-toggle="collapse" type="button">
                        <span></span>
                    </button>
                    {authNav}
                </div>
            
        )
    }

};

export default withAuth(Header);

@okta/okta-react

React support for Okta

Apache-2.0
Latest version published 5 months ago

Package Health Score

75 / 100
Full package analysis

Popular @okta/okta-react functions