Skip to content

Commit

Permalink
[SDK-1704] Add contributing and troubleshooting guides (#39)
Browse files Browse the repository at this point in the history
* Add contribution guide

* Add troubleshooting guide

* Fix a flakey test caused by Next.js hydrating the DOM
  • Loading branch information
adamjmcgrath authored Jun 17, 2020
1 parent 585dc7e commit 8771481
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 1 deletion.
40 changes: 40 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Contributing

We appreciate feedback and contribution to this repo! Before you get started, please see [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)

## Local development

Install the dependencies and start the development server:

```bash
npm install
npm start
```

This will run a development server at http://localhost:3000 with a simple application that demonstrates the main features of the SDK. When you make changes the development server will live reload.

You can change the default Auth0 tenant and application by editing the domain and clientId in [static/index.html](./static/index.html#L81-L82)

## Running the examples

The examples are React applications and an Express API. To run the example apps see the instructions in [examples/README.md](./examples/README.md)

## Running the unit tests

The unit tests use Jest and are run with:

```bash
npm test
```

## Running the integration tests

The integration tests run against the examples, so you must follow the instructions to set up the examples in [examples/README.md](./examples/README.md) first.

Then run:

```bash
CYPRESS_USER_EMAIL={YOUR USER} CYPRESS_USER_PASSWORD={YOUR PW} npm run test:integration
```

`CYPRESS_USER_EMAIL` and `CYPRESS_USER_PASSWORD` should be the credentials of a user on your Auth0 tenant that has the `read:users` permissions on the audience you specified when setting up the examples.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Auth0 SDK for React Single Page Applications (SPA).
- [Getting Started](#getting-started)
- [Contributing](#contributing)
- [Support + Feedback](#support--feedback)
- [Troubleshooting](#troubleshooting)
- [Vulnerability Reporting](#vulnerability-reporting)
- [What is Auth0](#what-is-auth0)
- [License](#license)
Expand Down Expand Up @@ -193,11 +194,16 @@ We appreciate feedback and contribution to this repo! Before you get started, pl

- [Auth0's general contribution guidelines](https://github.com/auth0/open-source-template/blob/master/GENERAL-CONTRIBUTING.md)
- [Auth0's code of conduct guidelines](https://github.com/auth0/open-source-template/blob/master/CODE-OF-CONDUCT.md)
- [This repo's contribution guide](./CONTRIBUTING.md)

## Support + Feedback

For support or to provide feedback, please [raise an issue on our issue tracker](https://github.com/auth0/auth0-react/issues).

## Troubleshooting

For information on how to solve common problems, check out the [Troubleshooting](./TROUBLESHOOTING.md) guide

## Vulnerability Reporting

Please do not report security vulnerabilities on the public GitHub issue tracker. The [Responsible Disclosure Program](https://auth0.com/whitehat) details the procedure for disclosing security issues.
Expand Down
10 changes: 10 additions & 0 deletions TROUBLESHOOTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Troubleshooting

When your application is not behaving as expected:

- Check for any messages in the console
- Check the Network Activity especially any requests to your authorization server
- Check the log data in your [Auth0 Dashboard](https://manage.auth0.com#/logs)
- Check the `@auth0/auth0-spa-js` [FAQs](https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md)

If you believe there is a bug in the SDK, [raise an issue](https://github.com/auth0/auth0-spa-js/issues/new/choose). Be sure to include all the information required to reproduce the issue.
2 changes: 1 addition & 1 deletion cypress/integration/smoke.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('Smoke tests', () => {
it('do basic login and show user', () => {
cy.visit('/');
cy.get('#login').should('exist');
cy.get('#login').click();
cy.get('#login').click({ force: true });

loginToAuth0();

Expand Down

0 comments on commit 8771481

Please sign in to comment.