Skip to main content

googleSignin Mutation

Description

Authenticates a user using a Google JWT token and creates a session.

mutation googleSignin($jwt: String!, $audience: String!) {
googleSignin(jwt: $jwt, audience: $audience) {
_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

{
"jwt": "jwt",
"audience": "audience"
}

Response

{
"googleSignin": {
"_id": "4b6f03b7b6450006fe020796",
"configRef": "d662c6721210e7fb35b686f7",
"type": "example",
"user": {
"_id": "9a4e0cd195bcdaaadc6c7183",
"firstName": "example",
"lastName": "example",
"name": "example",
"email": "email@example.com",
"addedAt": 1728707894952,
"type": "example",
"hasIntercom": true,
"hasPasscode": true,
"passwordToken": "example",
"lastLogin": 1735966559428
},
"jwt": "example",
"expires": 1706946001356,
"createdAt": 1709175592029,
"origin": "example",
"adminDomains": [
{
"_id": "476764856a508bd95dc08cc8",
"siteName": "example",
"active": true,
"domainName": "example"
}
],
"shopName": "example",
"admins": [
{
"_id": "2a7d69fa8d44668d7ced0953",
"email": "email@example.com",
"name": "example",
"avatar": "example",
"hasPasscode": true
}
],
"deviceName": "example",
"deviceId": "example",
"mfa": true,
"ip": "example"
}
}

Arguments

NameTypeDescription
jwtString!JSON Web Token from Google authentication.
audienceString!Expected audience for the JWT token, typically the Google client ID.

Returns

Session