The set of core options.
@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".
@default 'auth_remember'
The name under which the remember String is stored under.
@default 'auth_stay_signed_in'
The name under which the staySignedIn option from login is stored.
@default 'auth_token_default'
The name under which the default token String is stored under.
@default 'auth_token_impersonate'
The name under which the impersonate token String is stored under.
@default ['storage', 'cookie']
The order in which to attempt storage of "tokens" and "remember" String data.
@default { Path: '/', Domain: null, Secure: true, Expires: 12096e5, SameSite: 'None'}
The default params that will be set on cookies when cookie storage is enabled.
@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.
@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.
@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.
@default { url: 'auth/register', method: 'POST', redirect: '/login', autoLogin: false}
Default register request data.
If the
autoLoginis enabled it will subsequently trigger a login call. All options available to the login method will also be available here.
@default { url: 'auth/login', method: 'POST', redirect: '/', fetchUser: true, staySignedIn: true}
Default login request data.
@default { url: 'auth/logout', method: 'POST', redirect: '/', makeRequest: false}
Default logout request data.
@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.
@default { url: 'auth/user', method: 'GET', enabled: true}
Default fetch request data.
@default { url: 'auth/refresh', method: 'GET', enabled: true, interval: 30}
Default refresh request data.
@default { url: 'auth/impersonate', method: 'POST', redirect: '/', fetchUser: true}
Default impersonate request data.
@default { url: 'auth/unimpersonate', method: 'POST', redirect: '/admin', fetchUser: true, makeRequest: false}
Default unimpersonate request data.
@default _getUrl
The default url function used for redirect uri for bringing a user back to the app during oauth2 request.
@default _getDomain
The default domain function used when storing remember and token data in cookies.
@default _parseUserData
The default parser for user response data.