Skip to content

Commit 8771481

Browse files
authored
[SDK-1704] Add contributing and troubleshooting guides (auth0#39)
* Add contribution guide * Add troubleshooting guide * Fix a flakey test caused by Next.js hydrating the DOM
1 parent 585dc7e commit 8771481

File tree

4 files changed

+57
-1
lines changed

4 files changed

+57
-1
lines changed

CONTRIBUTING.md

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing
2+
3+
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)
4+
5+
## Local development
6+
7+
Install the dependencies and start the development server:
8+
9+
```bash
10+
npm install
11+
npm start
12+
```
13+
14+
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.
15+
16+
You can change the default Auth0 tenant and application by editing the domain and clientId in [static/index.html](./static/index.html#L81-L82)
17+
18+
## Running the examples
19+
20+
The examples are React applications and an Express API. To run the example apps see the instructions in [examples/README.md](./examples/README.md)
21+
22+
## Running the unit tests
23+
24+
The unit tests use Jest and are run with:
25+
26+
```bash
27+
npm test
28+
```
29+
30+
## Running the integration tests
31+
32+
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.
33+
34+
Then run:
35+
36+
```bash
37+
CYPRESS_USER_EMAIL={YOUR USER} CYPRESS_USER_PASSWORD={YOUR PW} npm run test:integration
38+
```
39+
40+
`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.

README.md

+6
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ Auth0 SDK for React Single Page Applications (SPA).
1818
- [Getting Started](#getting-started)
1919
- [Contributing](#contributing)
2020
- [Support + Feedback](#support--feedback)
21+
- [Troubleshooting](#troubleshooting)
2122
- [Vulnerability Reporting](#vulnerability-reporting)
2223
- [What is Auth0](#what-is-auth0)
2324
- [License](#license)
@@ -193,11 +194,16 @@ We appreciate feedback and contribution to this repo! Before you get started, pl
193194

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

197199
## Support + Feedback
198200

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

203+
## Troubleshooting
204+
205+
For information on how to solve common problems, check out the [Troubleshooting](./TROUBLESHOOTING.md) guide
206+
201207
## Vulnerability Reporting
202208

203209
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.

TROUBLESHOOTING.md

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Troubleshooting
2+
3+
When your application is not behaving as expected:
4+
5+
- Check for any messages in the console
6+
- Check the Network Activity especially any requests to your authorization server
7+
- Check the log data in your [Auth0 Dashboard](https://manage.auth0.com#/logs)
8+
- Check the `@auth0/auth0-spa-js` [FAQs](https://github.com/auth0/auth0-spa-js/blob/master/FAQ.md)
9+
10+
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.

cypress/integration/smoke.test.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('Smoke tests', () => {
1717
it('do basic login and show user', () => {
1818
cy.visit('/');
1919
cy.get('#login').should('exist');
20-
cy.get('#login').click();
20+
cy.get('#login').click({ force: true });
2121

2222
loginToAuth0();
2323

0 commit comments

Comments
 (0)