Skip to content

Commit

Permalink
Merge pull request aws-amplify#1396 from powerful23/cognito-hostedUI-doc
Browse files Browse the repository at this point in the history
fix(@aws-amplify/auth): dispatching failure event when hosted UI and documentation enhancement for hosted UI
  • Loading branch information
powerful23 authored Aug 13, 2018
2 parents db0b97c + 0263a71 commit 1b45b8b
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions docs/media/authentication_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -675,6 +675,10 @@ class MyApp extends React.Component {

export default withOAuth(MyApp);
```

#### Handling Authentication Events

When using the hosted UI, you can handle authentication events by creating event listeners with the [Hub module]({%if jekyll.environment == 'production'%}{{site.amplify.baseurl}}{%endif%}/media/hub_guide#listening-authentication-events).

### Enabling MFA

Expand Down
3 changes: 3 additions & 0 deletions docs/media/hub_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ AWS Amplify has a local event bus system called Hub. It is a lightweight impleme
Import:
```js
import { Hub } from 'aws-amplify';

// or
import { Hub } from '@aws-amplify/core';
```

## Working with the API
Expand Down
3 changes: 3 additions & 0 deletions docs/media/i18n_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ AWS Amplify I18n module is a lightweight internationalization solution.

```js
import { I18n } from 'aws-amplify';

// or
import { I18n } from '@aws-amplify/core';
```

## Working with the API
Expand Down
3 changes: 2 additions & 1 deletion packages/auth/src/Auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@ export default class AuthClass {
},
onFailure: (err) => {
logger.debug("Error in cognito hosted auth response", err);
dispatchAuthEvent('signIn_failure', err);
}
};
// if not logged in, try to parse the url.
Expand Down Expand Up @@ -320,7 +321,7 @@ export default class AuthClass {
resolve(user);
}
},
onFailure: (err) => {
onFailure: (err) => {
logger.debug('signIn failure', err);
dispatchAuthEvent('signIn_failure', err);
reject(err);
Expand Down

0 comments on commit 1b45b8b

Please sign in to comment.