Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Updating docs to reflect TOTP support in Authenticator for Swift #4615

Merged
merged 1 commit into from
Nov 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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")
}
)

```
Loading