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

DEVDOCS-5274: [update] GQL Overview, clarify no multiple sign in support #2122

Closed
wants to merge 1 commit into from
Closed
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
9 changes: 8 additions & 1 deletion docs/api-docs/storefront/graphql/graphql-api-overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ curl 'https://store.com/graphql' -H 'authorization: Bearer TOKEN_GOES_HERE' -H '

### Customer login

If you're using the GraphQL Storefront API from a browser, for example, on top of your Stencil storefront, you can use the Customer Login mutation to sign in to a customer account with an email address and a password. This will set a session cookie in the browser, which will authenticate the customer account on future requests:
If you're using the GraphQL Storefront API from a browser, for example, on top of your Stencil storefront, you can use the Customer Login mutation to sign in to a customer account with an email address and a password. This will set a session cookie in the browser, which will authenticate the customer account on future requests.

<Callout type="info">
Customers cannot have multiple log-ins from different devices.
Copy link
Contributor

@slsriehl slsriehl Dec 28, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Customers cannot have multiple log-ins from different devices.
Note: A customer cannot be signed in to their account on multiple devices at the same time.

</Callout>

```graphql filename="Example query: login mutation" showLineNumbers copy
mutation Login($email: String!, $pass: String!) {
Expand All @@ -222,6 +226,9 @@ mutation Login($email: String!, $pass: String!) {
}
}
```
<Callout type="info">
NOTE: Customers are restricted from multiple logins from different devices.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
NOTE: Customers are restricted from multiple logins from different devices.
Note: A customer cannot be signed in to their account on multiple devices at the same time.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we say more about the default behavior here? does BC automatically sign them out of the old device when you run the customer login mutation for a session on a new device?

</Callout>

This mutation is also useful for server-to-server or headless storefront applications using a Customer Impersonation Token. For example, this interface can validate a customer's email address + password to power a login form. When the credentials are correct, and the mutation returns successfully, you can take the resulting customer ID and store it in a session to use in the `x-bc-customer-id` header in future requests for that shopper.

Expand Down