open-index/open-npm huggingface dataset:
npm package: @kenetto/kenetto-redux-authenticator
Description: ## Usage
Latest version: 0.0.2

# Kenetto-Redux-Authenticator

## Usage

Install kenetto-redux-authenticator via npm.

    npm install --save @kenetto/kenetto-redux-authenticator

Import the necessary components

```js
import Auth from '@kenetto/kenetto-redux-authenticator'
import {Authenticator} from '@kenetto/kenetto-redux-authenticator'
```

Create the `configurationAuth0` with the necessary credentials. This should come from the environment variables.

The configuration must include domain, clientID, responseType, audience, scope and returnURI


Create an instance of the `Auth` class, which you will use for authentication.
```js
const auth = new Auth(configurationAuth0, configurationBaseName, configurationNameSpace)
```

Use the `auth.isAuthenticated()` to check if user is authenticated. The function returns a `boolean` with the result.

Use the `auth.logout()` method to logout. The method should receive a function which will push the next page path.

```js
auth.logout()
```


Use the `auth.login(redirectURI)` to login and redirect to pretended web page which needs to be passes to the method as a property.


```js
auth.login('/example')
```


Use `auth.getProfile()` to get the profile of the currently logged user.


```js
auth.getProfile().then(profile => {
  
  ...
  
  })
```