options
enable
- type:
boolean
- required:
false
- default:
qAuth:{
enable: true
}
debug
- type:
boolean
- required:
false
- default:
qAuth:{
debug: false
}
scopeKey
- type:
string
- required:
false
- default:
qAuth:{
scopeKey: 'scope'
}
vuex
- required:
false
- default:
qAuth:{
vuex:{
namespace: 'qAuth'
}
}
namespace
type :string
required :false
default :'qAuth'
strategies
- required:
true
- default:
qAuth:{
strategies: {
local: {
endpoints: {
login: false,
logout: false,
user: false
},
user: {
property: 'user'
},
token:{
property:'token'
}
}
}
}
strategies.local
- required:
true
strategies.local.endpoints
- required:
true
- default:
endpoints: {
login: false,
logout: false,
user: false
}
strategies.local.endpoints.login
- required:
true
- type:
{mutation: DocumentNode}
orfalse
- default:
false
It should be like the following :
login:{
mutation: gql`
mutation login($data:LoginInput!){
login(data:$data){
token
}
}
`
}
strategies.local.endpoints.logout
- required:
false
- type:
{mutation: DocumentNode}
orfalse
- default:
false
It can be like the following :
logout:{
mutation: gql`
mutation logout($data:LogoutInput!){
logout(data:$data){
...
}
}
`
}
strategies.local.endpoints.user
- required :
true
- type :
{query: DocumentNode}
orfalse
- default :
false
It should be like the following:
user:{
query: gql`
query me{
me{
user{
id
name
email
}
}
}
`
}
strategies.local.user.property
- required:
false
- type :
string
- default:
'user'
strategies.local.token.property
- required:
false
- type:
string
- default:
'token'
redirect
- required:
false
- default:
redirect: {
login: '/login',
logout: '/'
}
redirect.login
- required:
false
- type:
string
- default:
'/login'
redirect.logout
- required:
false
- type:
string
- default:
'/'