Authentication
Laravel CMS tries to authenticate against entries of the Laravel users
table. To be able to use the GraphQL API, they need to be editors (use the artisan
command to set the editor role):
php artisan cms:editor editor@example.com
Login
To authenticate for editing content:
mutation {
cmsLogin(email: "editor@example.com", password: "secret") {
name
email
}
}
{
"data": {
"cmsLogin": {
"name": "A CMS editor",
"email": "editor@example.com"
}
}
}
Retrieve user
Retrieve information about the authenticated user:
query {
me {
name
email
}
}
{
"data": {
"me": {
"name": "A CMS editor",
"email": "editor@example.com"
}
}
}
Logout
To log the current user out of the application:
mutation {
cmsLogout {
name
email
}
}
{
"data": {
"cmsLogout": {
"name": "A CMS editor",
"email": "editor@example.com"
}
}
}
Comments