Vue Auth / Options / Core

The set of core options.

rolesKey

@default 'roles'

The default field to check against on the user object when using "auth meta" or $auth.check().

The key also supports dot notation as in "my.role.key".

References

rememberKey

@default 'auth_remember'

The name under which the remember String is stored under.

References

staySignedInKey

@default 'auth_stay_signed_in'

The name under which the staySignedIn option from login is stored.

References

tokenDefaultKey

@default 'auth_token_default'

The name under which the default token String is stored under.

References

tokenImpersonateKey

@default 'auth_token_impersonate'

The name under which the impersonate token String is stored under.

References

stores

@default ['storage', 'cookie']

The order in which to attempt storage of "tokens" and "remember" String data.

References

cookie

@default {     Path: '/',     Domain: null,     Secure: true,     Expires: 12096e5,     SameSite: 'None' }

The default params that will be set on cookies when cookie storage is enabled.

References

authRedirect

@default {path: '/login'}

The router redirect to use if any authentication is required on a route.

This will trigger if meta.auth is set to anything other than undefined or false.

This also accepts a callback function which passes the transition for dynamic handling.

References

forbiddenRedirect

@default {path: '/403'}

The router redirect to use if a route is forbidden.

This will trigger if the user object's role property does not match up with the auth value.

This also accepts a callback function which passes the transition for dynamic handling.

References

notFoundRedirect

@default {path: '/404'}

The router redirect to use if route is "not found".

Typically used to hide pages while logged in. For instance we don't want the user to access a login or register page while they are authenticated. Hence a "404 Not Found".

This will trigger if auth.meta is set to false and the user is already authenticated.

This also accepts a callback function which passes the transition for dynamic handling.

References

registerData

@default {     url: 'auth/register',     method: 'POST',     redirect: '/login',     autoLogin: false }

Default register request data.

If the autoLogin is enabled it will subsequently trigger a login call. All options available to the login method will also be available here.

References

loginData

@default {     url: 'auth/login',     method: 'POST',     redirect: '/',     fetchUser: true,     staySignedIn: true }

Default login request data.

References

logoutData

@default {     url: 'auth/logout',     method: 'POST',     redirect: '/',     makeRequest: false }

Default logout request data.

References

oauth2Data

@default {     url: 'auth/social',     method: 'POST',     redirect: '/',     fetchUser: true }

Default oauth2 request data.

After a token is received and the API request is made this will execute via the login method. All options available to the login method will also be available here.

References

fetchData

@default {     url: 'auth/user',     method: 'GET',     enabled: true }

Default fetch request data.

References

refreshData

@default {     url: 'auth/refresh',     method: 'GET',     enabled: true,     interval: 30 }

Default refresh request data.

References

impersonateData

@default {     url: 'auth/impersonate',     method: 'POST',     redirect: '/',     fetchUser: true }

Default impersonate request data.

References

unimpersonateData

@default {     url: 'auth/unimpersonate',     method: 'POST',     redirect: '/admin',     fetchUser: true,     makeRequest: false }

Default unimpersonate request data.

References

getUrl

@default _getUrl

The default url function used for redirect uri for bringing a user back to the app during oauth2 request.

References

getDomain

@default _getDomain

The default domain function used when storing remember and token data in cookies.

References

parseUserData

@default _parseUserData

The default parser for user response data.

References