--- title: Require Login description: The API for interacting with the authentication. api_version: 2025-04 api_name: customer-account-ui-extensions source_url: html: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-04/apis/order-status-api/require-login md: >- https://shopify.dev/docs/api/customer-account-ui-extensions/2025-04/apis/order-status-api/require-login.md --- # Require Login The API for interacting with the authentication. ## OrderStatusApi The API object provided to this and other `customer-account.order-status` extension targets. * requireLogin () => Promise\ required The requireLogin() method triggers login if the customer is viewing pre-authenticated Order status page. Examples ### Examples * #### Call requireLogin before triggering an action ##### Description Call requireLogin before triggering an action ##### React ```jsx import React, { useEffect, useState } from "react"; import { Button, reactExtension, useApi, } from "@shopify/ui-extensions-react/customer-account"; export default reactExtension( "customer-account.order-status.block.render", () => ); function BlockExtension() { const { requireLogin } = useApi<"customer-account.order-status.block.render">(); async function reportAnIssue() { await requireLogin(); // send a request to backend } return ; } ``` ##### JavaScript ```js import React from "react"; import { extension, Button } from "@shopify/ui-extensions-react/customer-account"; export default extension( "customer-account.order-status.block.render", (root, api) => { async function reportAnIssue() { await api.requireLogin(); // send a request to backend } root.appendChild( root.createComponent(Button, { onPress: reportAnIssue }, "Report an issue"), ); }); ``` ## Related [Learn more - Order status page](https://shopify.dev/docs/apps/customer-accounts/order-status-page)