From 46161e571137e30b7676ed67f14233a1fbc33579 Mon Sep 17 00:00:00 2001 From: Harsh <6162866+harsh62@users.noreply.github.com> Date: Wed, 1 Nov 2023 13:08:25 -0400 Subject: [PATCH] chore(docs): Updating docs to reflect TOTP support in Authenticator for Swift (#4615) --- .../configuration/index.page.mdx | 4 +++ .../configuration/totpIssuer.swift.mdx | 11 ++++++++ ...tomization.full-ui-customization.swift.mdx | 27 +++++++++++++++++++ 3 files changed, 42 insertions(+) create mode 100644 docs/src/pages/[platform]/connected-components/authenticator/configuration/totpIssuer.swift.mdx diff --git a/docs/src/pages/[platform]/connected-components/authenticator/configuration/index.page.mdx b/docs/src/pages/[platform]/connected-components/authenticator/configuration/index.page.mdx index f6a8a7211d6..057f8a0843d 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/configuration/index.page.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/configuration/index.page.mdx @@ -115,3 +115,7 @@ with the exception of `address`, `gender`, `locale`, `picture`, `updated_at`, an {({ platform }) => import(`./hidesignup.${platform}.mdx`)} + + + {({ platform }) => import(`./totpIssuer.${platform}.mdx`)} + diff --git a/docs/src/pages/[platform]/connected-components/authenticator/configuration/totpIssuer.swift.mdx b/docs/src/pages/[platform]/connected-components/authenticator/configuration/totpIssuer.swift.mdx new file mode 100644 index 00000000000..7e883e8ce1c --- /dev/null +++ b/docs/src/pages/[platform]/connected-components/authenticator/configuration/totpIssuer.swift.mdx @@ -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") +} +``` diff --git a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.full-ui-customization.swift.mdx b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.full-ui-customization.swift.mdx index a8917de1be8..f45caaf1c20 100644 --- a/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.full-ui-customization.swift.mdx +++ b/docs/src/pages/[platform]/connected-components/authenticator/customization/customization.full-ui-customization.swift.mdx @@ -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") + } +) + +```