diff --git a/README.md b/README.md index 13e45c53..896bd6a1 100644 --- a/README.md +++ b/README.md @@ -237,7 +237,8 @@ Important environment variables include: | Variable | Purpose | | --- | --- | | `STOREFRONT_DB_CONNECTION` | Database connection name for Storefront models. | -| `STOREFRONT_BYPASS_VERIFICATION_CODE` | Development bypass code for Storefront app verification flows. | +| `STOREFRONT_BYPASS_VERIFICATION_CODE` | Instance-wide sign-in code for the review accounts in `STOREFRONT_REVIEW_ACCOUNTS` (self-hosted). Stores can instead turn on [App Review access](docs/app-review.md) in their settings. | +| `STOREFRONT_REVIEW_ACCOUNTS` | Comma-separated phone numbers and emails that sign in with `STOREFRONT_BYPASS_VERIFICATION_CODE` and are never sent a code. | | `STOREFRONT_THROTTLE_REQUESTS_PER_MINUTE` | Public Storefront API requests allowed per device (store key + client IP) per window. Default `120`. | | `STOREFRONT_THROTTLE_DECAY_MINUTES` | Public Storefront API throttle window in minutes. Default `1`. | @@ -248,6 +249,7 @@ For customer app configuration, see the [Storefront App configuration docs](http - [Storefront documentation](https://www.fleetbase.io/docs/storefront) - [Products and catalog](https://docs.fleetbase.io/guides/storefront/products/) - [Orders and checkout](https://www.fleetbase.io/docs/storefront/orders/overview) +- [App Review access](docs/app-review.md): letting Apple and Google reviewers sign in to a store's app - [Checkout flow](https://www.fleetbase.io/docs/storefront/orders/checkout) - [Store locations](https://www.fleetbase.io/docs/storefront/stores/store-locations) - [Storefront App configuration](https://www.fleetbase.io/docs/storefront/app/configuration) diff --git a/RELEASE.md b/RELEASE.md index 4205c6bf..d2839a90 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,14 +1,19 @@ -> v0.4.29 ~ "A phone sign-up keeps its number" +> v0.4.30 ~ "App store reviewers can sign in, Continue with Fleetbase, and answers in the customer's language" --- ## Highlights -- **Phone sign-up saves the number.** Signing up with a phone number and texted code created the account without that number: the app sends it as the `identity` the code was filed under, and account creation only read a separate `phone` field. Customers were then asked to verify the same number again, couldn't sign back in by phone, and the same number could sign up a second time. The verified identity is now the account's phone, on the user and the customer contact, and is marked verified (`phone_verified_at`), as is an existing user's matching number. A `phone` sent alongside still takes precedence. Email sign-up is unchanged. +- **App Review access.** Apple and Google reviewers can't receive the texted sign-in code, and Apple rejects apps its reviewers can't sign in to. A store or network can now turn on **Settings → App Review**: reviewers sign in with the test number +1 202 555 0143 (a range kept for fiction, never texted) and a six-digit code the owner creates in the Console and enters in App Store Connect and Google Play Console. The code is stored hashed and shown once; it works only in the store that created it. The mechanism is core-api's App Review access (core-api 1.6.74), which Navigator and future apps share. Reviewers can sign up, sign in, add the number at checkout and delete their account without a text message, on Fleetbase Cloud as well as self-hosted. See [docs/app-review.md](docs/app-review.md). +- **Reviewers' orders are marked.** Orders placed by the review account carry `meta.app_review = true`, are labelled **App Review order** in the order panel and staff alerts, and are never auto-dispatched to a driver. +- **Self-hosted review accounts keep working** (`STOREFRONT_BYPASS_VERIFICATION_CODE` with `STOREFRONT_REVIEW_ACCOUNTS`), now for sign-up as well, and the accounts they list are never sent a code. +- **Endpoints and permission.** The Console uses core's `GET|PUT /int/v1/review-access/storefront-store/{id}` (and `storefront-network`). A new permission, `storefront manage-app-review store` / `network`, is needed to change it. (#162) +- **Continue with Fleetbase.** Apps signed in with core-api's OAuth provider (core-api 1.6.74) can, with an organization administrator's consent, read the organization's stores and networks with their public keys (`storefront:read`, `GET /storefront/oauth/v1/storefronts`), get a dedicated API key for their Storefront app (`storefront:app-key`, `POST /storefront/oauth/v1/app-key`, listed under Developers → API Keys) and turn App Review access on or off (`storefront:review-access`, through core's `/oauth/v1/review-access/storefront-store/{id}`). This is how AppHelm connects a Cloud customer's storefront without pasting keys. (#163) +- **Answers in the customer's language.** The customer app already sends `Accept-Language`, but the server ignored it. Storefront API errors, validation messages, SMS verification and account-closure texts, push notifications and inbox items now come back in the closest shipped language (English, Mongolian or Ukrainian; anything else gets English). A signed-in customer's language is remembered in their contact's `meta.locale`, so queued order notifications use it too. Merchant-authored text, error codes and core-api / Fleet-Ops messages are unchanged, and English text is identical to before. (#164) --- ## Upgrading -- No migrations. -- Accounts created by phone before this release have no phone saved. They are asked to add it once in the app (Storefront App v0.1.1 also asks at checkout). +- **Requires fleetbase/core-api v1.6.74** (`composer.json` now requires `^1.6.74`), which adds App Review access (fleetbase/core-api#323) and the OAuth provider (fleetbase/core-api#324). Run migrations: core adds `review_accesses` and the OAuth tables; Storefront adds none. +- Grant `manage-app-review` on stores or networks to staff who aren't administrators and should manage App Review access (the Storefront Administrator role's full-access policy already covers it). --- ## Need help? diff --git a/addon/components/storefront/app-review-access.hbs b/addon/components/storefront/app-review-access.hbs new file mode 100644 index 00000000..63c235d1 --- /dev/null +++ b/addon/components/storefront/app-review-access.hbs @@ -0,0 +1,79 @@ +{{! App Review access: the test number and code Apple and Google reviewers sign in with. Buttons only, no inputs, so it can sit inside a settings form without marking it dirty. }} +
{{t "storefront.settings.app-review.lede"}}
+ {{#if this.status}} +{{t "storefront.settings.app-review.code-new"}}
+ {{else if this.status.has_code}} +{{t "storefront.settings.app-review.code-hidden" date=this.codeCreatedAt}}
+ {{else}} +{{t "storefront.settings.app-review.code-none"}}
+ {{/if}} +