This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<v-layout align-center justify-center> | |
<v-flex xs12 sm8 md4> | |
<v-card class="elevation-12"> | |
<v-toolbar dark color="primary"> | |
<v-toolbar-title>Login</v-toolbar-title> | |
</v-toolbar> | |
<v-card-text> | |
<form @submit.prevent="validate" aria-label="Login"> | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Imports | |
import Vue from 'vue' | |
import VueRouter from 'vue-router' | |
import Vuetify from 'vuetify' | |
import VeeValidate from 'vee-validate' | |
import VueApollo from 'vue-apollo' | |
import App from '@/App' | |
import routes from '@/routes.js' | |
import {apolloProvider} from '@/config/apollo.js' | |
import VueAuth from '@/plugins/vue-auth-graphql' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mutation login($data: LoginInput) { | |
login(data: $data) | |
} | |
mutation logout { | |
logout { | |
status | |
message | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {login, refresh, logout, register, checkDomain, updatePassword, forgotPassword, check} from '@/queries/auth.gql' | |
import {Apollo} from '@/config/apollo.js' | |
const Plugin = { | |
install (Vue, options = {}) { | |
//Add $auth api methods | |
Vue.prototype.$auth = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { ApolloClient } from 'apollo-client' | |
import { HttpLink } from 'apollo-link-http' | |
import { InMemoryCache } from 'apollo-cache-inmemory'; | |
import { onError } from "apollo-link-error"; | |
import { ApolloLink } from 'apollo-link'; | |
import VueApollo from 'vue-apollo' | |
import { vm } from '@/app.js' | |
const token = document.head.querySelector('meta[name="csrf-token"]').content |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\GraphQL\Resolvers; | |
use Illuminate\Support\Facades\Auth; | |
use GraphQL\Type\Definition\ResolveInfo; | |
use Nuwave\Lighthouse\Exceptions\AuthenticationException; | |
use Nuwave\Lighthouse\Support\Contracts\GraphQLContext; | |
use Illuminate\Support\Facades\Cookie; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
input LoginInput { | |
username: String! | |
password: String! | |
} | |
type LogoutResponse { | |
status: String! | |
message: String | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\GraphQL\Resolvers; | |
use GraphQL\Type\Definition\ResolveInfo; | |
use Nuwave\Lighthouse\Support\Contracts\GraphQLContext; | |
use Nuwave\Lighthouse\Exceptions\AuthenticationException; | |
use Illuminate\Support\Facades\Auth; | |
use Illuminate\Support\Facades\Cookie; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"A datetime string with format 'Y-m-d H:i:s', e.g. '2018-01-01 13:00:00'." | |
scalar DateTime @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\DateTime") | |
"A date string with format 'Y-m-d', e.g. '2011-05-23'." | |
scalar Date @scalar(class: "Nuwave\\Lighthouse\\Schema\\Types\\Scalars\\Date") | |
type Query @protect(guards: ["api"]) { | |
users: [User!]! @all(model: "App\\User") | |
user(id: ID @eq): User @find(model: "App\\User") | |
tickets: [Ticket!]! @all(model: "App\\Ticket") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\GraphQL\Directives; | |
use Nuwave\Lighthouse\Exceptions\AuthenticationException; | |
use Illuminate\Contracts\Auth\Factory as Auth; | |
use GraphQL\Language\AST\Node; | |
use GraphQL\Language\AST\NodeList; | |
use GraphQL\Language\AST\FieldDefinitionNode; | |
use GraphQL\Type\Definition\ResolveInfo; |
NewerOlder