Skip to content

Commit

Permalink
Document the configurable parameter of withAuthenticator
Browse files Browse the repository at this point in the history
  • Loading branch information
rlmartin committed Feb 14, 2018
1 parent 19bfef1 commit 342c124
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ AWS Amplify is a JavaScript library for frontend and mobile developers building
* [Examples](#example)
- [1. Collect user session metrics.](#1-collect-user-session-metrics)
- [2. Add Authentication](#2-add-authentication-to-your-app)
- [3. Sign HTTP requests](#3-sign-http-requests)
- [4. Upload and Download public or private content](#4-upload-and-download-public-or-private-content)
- [3. Override default authentication screens](#3-override-default-authentication-screens)
- [4. Sign HTTP requests](#4-sign-http-requests)
- [5. Upload and Download public or private content](#5-upload-and-download-public-or-private-content)
* [Contributing](#contributing)

## Installation
Expand Down Expand Up @@ -139,7 +140,40 @@ class App extends Component {
export default withAuthenticator(App);
```

### 3. Sign HTTP requests
### 3. Override default authentication screens

The `withAuthenticator` HOC gives you some good default authentication screens. But if you need to
customize those screens with more than simply styles, it also provides an optional third parameter
through which you can pass the list of customized (or not) screens:

```js
import React, { Component } from 'react';
import { ConfirmSignIn, ConfirmSignUp, ForgotPassword, SignIn, SignUp, VerifyContact, withAuthenticator } from 'aws-amplify-react';

class App extends Component {
render() {
...
}
}

class MySignIn extends SignIn {
render() {
...
}
}

export default withAuthenticator(App, false, [
<MySignIn/>,
<ConfirmSignIn/>,
<VerifyContact/>,
<SignUp/>,
<ConfirmSignUp/>,
<ForgotPassword/>
]);

```

### 4. Sign HTTP requests

Sign REST requests with [AWS Signature Version 4](http://docs.aws.amazon.com/general/latest/gr/signature-version-4.html) using the API module to one or multiple endpoints:

Expand All @@ -154,7 +188,7 @@ API.get(apiName, path, options).then(response => {
});
```

### 4. Upload and Download public or private content
### 5. Upload and Download public or private content

With configurable settings, store content in an S3 bucket in public folders for all of your application's users or in private folders for each user identity:

Expand Down

0 comments on commit 342c124

Please sign in to comment.