sessionLogin Mutation
Description
Authenticates a user with email and password, creating a new session. Invalidates any existing backoffice sessions for the user. After 3 failed login attempts, the account is locked and requires a password reset. Returns the new session with user information and admin domains.
mutation sessionLogin($email: String!, $password: String!) {
sessionLogin(email: $email, password: $password) {
_id
configRef
type
user {
_id
firstName
lastName
name
email
addedAt
type
hasIntercom
hasPasscode
passwordToken
lastLogin
}
jwt
expires
createdAt
origin
adminDomains {
_id
siteName
active
domainName
}
shopName
admins {
_id
email
name
avatar
hasPasscode
}
deviceName
deviceId
mfa
ip
}
}
Variables
{
"email": "email@example.com",
"password": "password"
}
Response
{
"sessionLogin": {
"_id": "51255bc2a96040e5336c000c",
"configRef": "c0ea4b83d0fc1ee2852bb301",
"type": "example",
"user": {
"_id": "537b89a34e7b7ba9bf4f108e",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"addedAt": 1733765643024,
"type": "example",
"hasIntercom": true,
"hasPasscode": true,
"passwordToken": "example",
"lastLogin": 1758308558358
},
"jwt": "example",
"expires": 1740116115858,
"createdAt": 1744458691268,
"origin": "example",
"adminDomains": [
{
"_id": "755577c950d3fa89f9e5d34b",
"siteName": "example",
"active": true,
"domainName": "example"
}
],
"shopName": "example",
"admins": [
{
"_id": "117ade0c77763c4ec5f2941d",
"email": "email@example.com",
"name": "example",
"avatar": "example",
"hasPasscode": true
}
],
"deviceName": "example",
"deviceId": "example",
"mfa": true,
"ip": "example"
}
}
Arguments
| Name | Type | Description |
|---|---|---|
email | String! | Email address of the user to authenticate. |
password | String! | Password for authentication. |