Skip to content

Commit

Permalink
chore(docs): Updating docs to reflect TOTP support in Authenticator f…
Browse files Browse the repository at this point in the history
…or Swift (#4615)
  • Loading branch information
harsh62 authored Nov 1, 2023
1 parent 2a9327e commit 46161e5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,3 +115,7 @@ with the exception of `address`, `gender`, `locale`, `picture`, `updated_at`, an
<Fragment useCommonWebContent platforms={['web', 'react-native', 'swift']}>
{({ platform }) => import(`./hidesignup.${platform}.mdx`)}
</Fragment>

<Fragment useCommonWebContent platforms={['swift']}>
{({ platform }) => import(`./totpIssuer.${platform}.mdx`)}
</Fragment>
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
## TOTP Issuer

The TOTP issuer is the name that will be shown in TOTP applications preceding the account name. In most cases, this should be the name of your app. For example, if your app is called "My App", your user will see "My App" - "username" in their TOTP app. This can be customized by adding the `totpOptions` argument to the Authenticator component with a value for `issuer`.

Note: Unless changed, the default issuer is the application name retrieved from the project configuration. The key for this value is `CFBundleDisplayName` on iOS found in `info.plist`.

```swift
Authenticator(totpOptions: .init(issuer: "My App")) { _ in
Text("Signed In Content")
}
```
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,30 @@ struct CustomSignInView: View {
}

```

### TOTP Setup

You can also customize the TOTP setup experience. We make available arguments in the `ContinueSignInWithTOTPSetupView` i.e. `qrCodeContent` and `copyKeyContent` that can help you provide custom content for the TOTP Setup Experience. In the example below, examine how you could customize the setup screen.

```swift
Authenticator(
continueSignInWithTOTPSetupContent: { state in
ContinueSignInWithTOTPSetupView(
state: state,

// Example of how a customer can pass a custom QR code
qrCodeContent: { state in
// Your custom QR Code implementation goes here

},
copyKeyContent: { state in
// YOUR custom implementation goes here
}
)
},
content: { state in
Text("Signed In Content")
}
)

```

0 comments on commit 46161e5

Please sign in to comment.