Skip to main content

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": "36f43bcb906fde9d86f6a696",
"configRef": "04337163faa35ce342929c6a",
"type": "example",
"user": {
"_id": "80c3a2d3fec0db18d03da6bb",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"addedAt": 1722051810903,
"type": "example",
"hasIntercom": true,
"hasPasscode": true,
"passwordToken": "example",
"lastLogin": 1713489299172
},
"jwt": "example",
"expires": 1738624278927,
"createdAt": 1740221282520,
"origin": "example",
"adminDomains": [
{
"_id": "5a41125c0eb7b51adb43c045",
"siteName": "example",
"active": true,
"domainName": "example"
}
],
"shopName": "example",
"admins": [
{
"_id": "73286f88efef796b2cbf2cd2",
"email": "email@example.com",
"name": "example",
"avatar": "example",
"hasPasscode": true
}
],
"deviceName": "example",
"deviceId": "example",
"mfa": true,
"ip": "example"
}
}

Arguments

NameTypeDescription
emailString!Email address of the user to authenticate.
passwordString!Password for authentication.

Returns

Session