Answer the question
In order to leave comments, you need to log in
How to properly populate ScopeKey in Nuxt.JS?
For authorization I use the nuxt-auth module. The documentation says very little about ScopeKey and even less about how to fill it.
Scopes or user roles I want to take from Django. Django can give them to me without any problems. The question is at what point how and where to transfer this field.
nuxt-auth config is like this
auth: {
strategies: {
local: {
scheme: 'refresh',
localStorage: {
prefix: 'auth.'
},
token: {
prefix: 'access_token.',
property: 'access_token',
maxAge: 86400,
type: 'Bearer'
},
refreshToken: {
prefix: 'refresh_token.',
property: 'refresh_token',
data: 'refresh_token',
maxAge: 60 * 60 * 24 * 15
},
user: {
property: 'user',
autoFetch: true
},
endpoints: {
login: { url: '/login', method: 'post'},
refresh: { url: '/token/refresh/', method: 'post' },
user: { url: '/user', method: 'get' },
logout: { url: '/logout', method: 'post'}
},
}
}
},
Answer the question
In order to leave comments, you need to log in
I don’t understand either, but I think so:
in the default config
auth: {
scopeKey: 'scope',
...
auth: {
scopeKey: 'role.name',
...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question