Skip to content

Commit 80589d7

Browse files
authored
fix(android): add instuctions to handle sign in cancellation for webui (aws-amplify#4791)
1 parent 93ece02 commit 80589d7

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/fragments/sdk/auth/android/hosted-ui.mdx

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,22 @@ If you want to sign out locally by just deleting tokens, you can call `signOut`
368368
AWSMobileClient.getInstance().signOut();
369369
```
370370

371+
### Add Response handler
372+
373+
Add the result handler if you need to capture sign in cancellations that occurred before the user submitted credentials.
374+
375+
```java
376+
@Override
377+
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
378+
super.onActivityResult(requestCode, resultCode, data);
379+
380+
if (requestCode == AuthClient.CUSTOM_TABS_ACTIVITY_CODE &&
381+
resultCode == Activity.RESULT_CANCELLED) {
382+
// handle cancelled sign in
383+
}
384+
}
385+
```
386+
371387
### Manual Setup
372388

373389
To configure your application for hosted UI, you need to use *HostedUI* options. Update your `awsconfiguration.json` file to add a new configuration for `Auth`. The configuration should look like this:

0 commit comments

Comments
 (0)