-
Notifications
You must be signed in to change notification settings - Fork 110
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -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. | ||||||
</Callout> | ||||||
|
||||||
```graphql filename="Example query: login mutation" showLineNumbers copy | ||||||
mutation Login($email: String!, $pass: String!) { | ||||||
|
@@ -222,6 +226,9 @@ mutation Login($email: String!, $pass: String!) { | |||||
} | ||||||
} | ||||||
``` | ||||||
<Callout type="info"> | ||||||
NOTE: Customers are restricted from multiple logins from different devices. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.